Best practice for using ArcGIS Server tokens

136
2
03-18-2020 11:47 AM
MichaelThompson
New Contributor III

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
New Contributor III

I appreciate your response, Jake.

0 Kudos