Ik gebruik de .NET proxy<\/A> voor app-login op een webapplicatie. De proxy.config werkt als ik individuele URL's specificeer. Bijvoorbeeld:<\/P><serverUrl url="https:\/\/<\/A>myserver<\/EM>\/arcgis\/rest\/services\/myname<\/EM>\/MapServer<\/STRONG>"<\/SPAN><\/P> clientId="aaa"<\/SPAN><\/P> clientSecret="bbb"<\/SPAN><\/P> oauth2Endpoint="<\/SPAN>https:\/\/<\/A>myserver<\/EM>\/portal\/sharing\/rest\/oauth2"<\/SPAN><\/P> matchAll="true"\/><\/SPAN><\/P><\/P>Ik wil de proxy gebruiken voor meerdere services op onze server, maar iets als dit resulteert in ongeldig gegenereerde tokens:<\/SPAN><\/P><serverUrl url="https:\/\/<\/A>myserver<\/EM>\/arcgis\/rest\/services\/<\/STRONG>"<\/SPAN><\/P> clientId="aaa"<\/SPAN><\/P> clientSecret="bbb"<\/SPAN><\/P> oauth2Endpoint="<\/SPAN>https:\/\/<\/A>myserver<\/EM>\/portal\/sharing\/rest\/oauth2"<\/SPAN><\/P> matchAll="true"\/><\/SPAN><\/P><\/P>Is het mogelijk om dit soort "gedeeltelijke" overeenkomst op de URL te specificeren met behulp van de proxy?<\/STRONG><\/SPAN><\/P><\/P>Uit de documentatie:<\/SPAN><\/P>Voeg een nieuwe <\/SPAN><serverUrl><\/CODE>-vermelding toe voor elke service die de proxy zal gebruiken. De proxy.config staat toe dat je de serverUrl-tag gebruikt om een of meer ArcGIS Server-services te specificeren waarnaar de proxy verzoeken zal doorsturen. De serverUrl-tag heeft de volgende attributen:<\/SPAN><\/EM><\/P>url<\/STRONG>: Locatie van de ArcGIS Server-service (of andere URL) om te proxien. Specificeer ofwel de specifieke URL of de root (in dat geval moet je matchAll=\"false\" instellen).<\/EM><\/LI><\/UL><\/BODY><\/HTML>
<serverUrl url="
<serverUrl><\/CODE>-vermelding toe voor elke service die de proxy zal gebruiken. De proxy.config staat toe dat je de serverUrl-tag gebruikt om een of meer ArcGIS Server-services te specificeren waarnaar de proxy verzoeken zal doorsturen. De serverUrl-tag heeft de volgende attributen:<\/SPAN><\/EM><\/P>url<\/STRONG>: Locatie van de ArcGIS Server-service (of andere URL) om te proxien. Specificeer ofwel de specifieke URL of de root (in dat geval moet je matchAll=\"false\" instellen).<\/EM><\/LI><\/UL><\/BODY><\/HTML>
Yes, but since it's not working, I'm wondering if it's misconfigured. I'm using Portal for ArcGIS Server 10.3, so I login to Portal > Add Item > An Application > Web Mapping with URL to the root of my site, Ready to Use, JavaScript API. I then view the item details in Portal and register it. I've tried a number of Redirect URI's thinking that might be the problem. I've tried the proxy, the page that calls the map, the home page. I've tried sharing with Everyone to eliminate that as an issue. The result is always an invalid token.
Pam,
Are you registering your production website application url to get your client Id and secret?
Robert, thank you for the response. I am using the latest proxy. The original post was a red herring. I don't think it's the way the serverUrl is specified as much as it is that the clientId and clientSecret don't work. Using the username and password works. Problem is, we generally avoid storing clear text login information in source code, even if the client can't see it. The clientId and clientSecret are more limited in access than a regular account. It seems my issue is related to using an application.
FYI:
IMPORTANT – as of today, 5/21/215, the release version of the proxy.ashx file for .NET and the most recent version of ArcServer do not play well together when token authentication is required. This is because 10.3 requires that token requests are done with a POST. the version above will attempt a GET resulting in a difficult to debug error. The issue can be found here: https://github.com/Esri/resource-proxy/issues/177A fix can be found here: https://github.com/esoekianto/resource-proxy-1/blob/45d9a49b58e3405c08a4f9e7157c491067b66760/DotNet/proxy.ashx - See more at: http://blogs.esri.com/esri/supportcenter/2015/04/07/setting-up-a-proxy/
IMPORTANT – as of today, 5/21/215, the release version of the proxy.ashx file for .NET and the most recent version of ArcServer do not play well together when token authentication is required. This is because 10.3 requires that token requests are done with a POST. the version above will attempt a GET resulting in a difficult to debug error.
The issue can be found here: https://github.com/Esri/resource-proxy/issues/177
A fix can be found here: https://github.com/esoekianto/resource-proxy-1/blob/45d9a49b58e3405c08a4f9e7157c491067b66760/DotNet/proxy.ashx
- See more at: http://blogs.esri.com/esri/supportcenter/2015/04/07/setting-up-a-proxy/
Not sure if the above applies to you but using the latest proxy may help.
Also I use a username and password with tokenServiceUri in your secured serviceUrls:
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.