RestAPI - returning Invalid Token intermittently

1280
5
04-16-2021 06:46 AM
AlexRystrom
New Contributor II

I have an application that has been running for 5 years which uses the dotnet proxy code from https://github.com/Esri/resource-proxy to access protected layers for a webmap.

Tuesday evening we started to intermittently receiving an "Invalid Token" response using this and the mapping part of our application has become unusable for most our user base.

This message was on the https://status.arcgis.com/ page Wednesday morning:
The ArcGIS.com system will be undergoing maintenance on April 13th, 2021 between the times of 5pm and midnight Pacific Time. While we don't anticipate any significant downtime, you may experience some minimal disruption during this maintenance period.

This is the only thing that's changed. Has anyone else started receiving this "Invalid Token" response intermittently?

 

Tags (3)
0 Kudos
5 Replies
AlexRystrom
New Contributor II

In case anyone else runs into this:

The first step towards fixing this was to update the JSAPI code to use the latest version. It was using version 3.16 and has been updated to 3.35. That has resolved the 'invalid token' issue. The application is now getting an intermittent "The remote server returned an error: (504) Gateway Timeout." error. 

0 Kudos
StuartMoore
Occasional Contributor III

i'm getting similar issues with a python script i've been using for the past 3 years

it seems like somethings changed with the API to request the token as i get the response: 

 

{"error":{"code":400,"message":"Unable to generate token.","details":["POST request should not contain username and password in the query string."]}}

 

but having said that i have another script this time in c# that still works fine and that uses the same method to get the token

 

0 Kudos
AlexRystrom
New Contributor II

I just started seeing this yesterday while testing and manually calling the post via postman or powershell. It appears you can no longer post with the parameters in the query string. You have to send this information in the body of the request now. 

StuartMoore
Occasional Contributor III

thanks for that i changed my python from:

r = requests.post(url, params=payload, proxies=proxies)

to 

r = requests.post(url, data=payload, proxies=proxies)

and its all working now 🙂

shame the documentation wasn't updated...

 

Stu

0 Kudos
AlexRystrom
New Contributor II

I'm trying to find out where to get a list of all these changes. Support sent me this related to this one specifically: https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEyOTc2Mg==

 

0 Kudos