Using Federated Portal 10.3 with DotNet proxy using application authentication, we are getting an error code 498 when trying to access a secure map service that was created with the same account as the registered app. I verified that the clientId and clientSecret (appId and appSecret) are valid. ArcGIS and Portal are on the same server. In case it is a factor, the web adapter was changed from "arcgis" to "portal", so logging in to Portal and the oAuth path start with <A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyservername.com%2Fportal" target="_blank">https://myservername.com/portal</A> rather than <A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyservername.com%2Farcgis" target="_blank">https://myservername.com/arcgis</A>, but the map services still reference <A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyservername.com%2Farcgis" target="_blank">https://myservername.com/arcgis</A>.
Error in Chrome:
dojo.io.script.jsonp_dojoIoScript1._jsonpCallback({"error":{"code":498,"message":"Invalid Token","details":[]}});
proxy.config:
<SPAN><?xml version="1.0" encoding="utf-8" ?> <ProxyConfig allowedReferers="*" mustMatch="true"><serverUrls> <serverUrl url="</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyservername.com" target="_blank">https://myservername.com</A><SPAN>" clientId="xyz" clientSecret="xyz" oauth2Endpoint="</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fmyservername.com%2Fportal%2Fsharing%2Frest%2Foauth2%2F" target="_blank">https://myservername.com/portal/sharing/rest/oauth2/</A><SPAN>" matchAll="true"/> </serverUrls></ProxyConfig></SPAN>
I get the following when doing detailed logging of the proxy (tokens modified):
2015-12-01 10:21:40 https://myservername.com/arcgis/rest/services/20151116_180423/MapServer?f=json&dpi=96&transparent=true&format=png24&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback
2015-12-01 10:21:40 Sending request!
2015-12-01 10:21:40 Renewing token and trying again.
2015-12-01 10:21:40 Matching credentials found in configuration file. OAuth 2.0 mode: True
2015-12-01 10:21:40 Service is secured by https://myservername.com/portal/sharing/oauth2/: getting new token...
2015-12-01 10:21:40 Sending request!
2015-12-01 10:21:40 Token obtained: to-qcTzUb_wvPLG2bxoGEadmmdpe4BTsFgHEyoqjmYi0GEJ4g1lO-ECEz28Wl8p5P5gNgc8aUA-maUxZ-beXRNlvkTRmZXxGbf-CC5oyajQ6bqX_WVTC57XDflWaza-fbw1yPF0kC7lDgB8VMHg..
2015-12-01 10:21:40 Exchanging Portal token for Server-specific token for https://myservername.com/arcgis/rest/services/...
2015-12-01 10:21:40 Sending request!
2015-12-01 10:21:41 Token obtained: bzFOQbHno6eZ2i9DUievUqHFuFctqxiIA11b3rbVGhMHtKzQ0xN29dA35QDD2U-tKJm9tfKEngF-cgoYLFiF4JqxLqSQAzavQWL3t17R6KUlx5HQAlL_mDiDP77H85N-iZDxTWDhsyUFUWgQRpw..
2015-12-01 10:21:41 Sending request!