ArcGIS REST API Token Management

154
1
Jump to solution
08-13-2020 11:37 AM
DamonDelNegro
New Contributor II

Hello All,

I am building a custom widget for use with the Web AppBuilder and it will be using the REST API.  I am struggling with how to manage the token once it is acquired.  My logic thus far is that the widget will get a token when it is initialized.  Where I am stuck is: a) how to check for an expiration, b) when to check for an expiration.  I thought about getting a new token with every request, but that doesn't seem right.  What is the strategy for token management?

Thank you.

1 Solution

Accepted Solutions
HarishPalaniappan
New Contributor III

Hi Damon DelNegro,

Since your code/app is generating the token in the first place, you can set an expiration parameter. If not set, by default tokens generated have expiration of 60 minutes.

 

If you are using ArcGIS JS – IdentityManager – it has generateToken method – here’s the link

https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html

 

If you have any additional questions please feel free to contact us.

arcgis-insight‌ arcgis rest api

View solution in original post

1 Reply
HarishPalaniappan
New Contributor III

Hi Damon DelNegro,

Since your code/app is generating the token in the first place, you can set an expiration parameter. If not set, by default tokens generated have expiration of 60 minutes.

 

If you are using ArcGIS JS – IdentityManager – it has generateToken method – here’s the link

https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html

 

If you have any additional questions please feel free to contact us.

arcgis-insight‌ arcgis rest api

View solution in original post