Esri/resource-proxy

Failed do detect expired token with callback param

Closed this issue · 3 comments

After digging around a bit I found a case scenario that fail to renew a token.

Some details:
Proxy version: 1.1.2
ArcGis: 10.6 (supposedly this issue was not occurring with 10.3)
Relevant Url params: f=json and callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback
Token Expiration: 1 minute

string uri = tokenServiceUri + "?f=json&request=getToken&referer=" + PROXY_REFERER + "&expiration=60&username=" + su.Username + "&password=" + su.Password;

  1. First run, token created and everything looks good;
  2. After a minute or so, token expires
  3. Proxy calls fetchAndPassBackToClient()
    private bool fetchAndPassBackToClient(System.Net.WebResponse serverResponse, HttpResponse clientResponse, bool ignoreAuthenticationErrors) {

This function expects a ContentType within text, json or xml. It then proceeds to check the body for error codes (498 or 499). However, due to the callback param, the response type is an 'application/javascript' like this:

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

Since it doesn't fit the initial criteria, the proxy class considers the old token as valid, therefore happily returns the response for the client.

We are experiencing the exact same issue when accessing a 10.6 rest service with DotNet proxy.

After working with ESRI support for quite some time, this is the proposed workaround: set a shorter recycling time in IIS for the proxy’s application pool, say 55 minutes.

I consider this fix as temporary, and I am looking forward to a true fix in the proxy.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you need additional assistance please contact Esri Technical Support. Thank you for your contributions.

This issue has been automatically closed due to inactivity. If you need additional assistance please contact Esri Technical Support.