Select to view content in your preferred language

Alternatives for token refresh

113
1
Monday
LarsLægreidjensen
New Contributor

I'm currently constructing an API that will query Enterprise REST services using an access token. The end user is asked to provide the access token when querying the API. 

The api is very long-running, and we have discovered that the token times out before data extraction is complete. The customer is reluctant to increase token expiry time. Can someone please provide some suggestions on how to deal with token expiration?

0 Kudos
1 Reply
John-Foster
Esri Contributor

typically ArcGIS services reply with error 498 when a token has expired (there are other possible reasons). when you handle that 498 response your workflow should be to use your token generation workflow to get a new refreshed token.

see these articles for more information:

https://developers.arcgis.com/documentation/security-and-authentication/reference/rest-authenticatio...

- https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/flows/...

- https://developers.arcgis.com/documentation/security-and-authentication/user-authentication/flows/en...

--jf
0 Kudos