Select to view content in your preferred language

Best practice for using ArcGIS Server tokens

631
2
03-18-2020 11:47 AM
MichaelThompson
Regular Contributor

What is the best practice for using ArcGIS Server tokens (generateToken) with the REST API? Should I request a new token for every request; or retain the token and request a new one when it nears expiration?

Thanks!
Michael

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor

Hey Michael,

Generating a token is extremely quick.  I always generate a new one for each request.  I think this will eliminate trying a request, creating a exception because the token is expired, generate a new token, and then trying the request again. 

MichaelThompson
Regular Contributor

I appreciate your response, Jake.

0 Kudos