AnsweredAssumed Answered

oAuth DotNet Proxy with Portal 10.3 Error 498 Invalid Token

Question asked by webbiep on Dec 1, 2015
Latest reply on Jun 4, 2018 by Szymon.Piskula_WoodMacOnline

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 https://myservername.com/portal rather than https://myservername.com/arcgis, but the map services still reference https://myservername.com/arcgis.

Error in Chrome:
dojo.io.script.jsonp_dojoIoScript1._jsonpCallback({"error":{"code":498,"message":"Invalid Token","details":[]}});

proxy.config:
<?xml version="1.0" encoding="utf-8" ?> <ProxyConfig allowedReferers="*" mustMatch="true"><serverUrls> <serverUrl url="https://myservername.com" clientId="xxx" clientSecret="xxx" oauth2Endpoint="https://myservername.com/portal/sharing/rest/oauth2/" matchAll="true"/> </serverUrls></ProxyConfig>

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!

Outcomes