AnsweredAssumed Answered

Support the Expiration of Token in Android App

Question asked by eduard.lepner2 on Sep 15, 2014

We're developing an android app which uses ArcGIS SDK for Android. In order to connect to secure layers we're using token based authorization.

When the requested token has expired we'd like to refresh it but I cannot find a way how to catch this moment. What actually the ArcGIS library does is just writes error messages into log when a user pans or zooms:

com.esri.core.io.EsriSecurityException: Invalid request <br>Usage: https://arcgis.example.com/arcgis/tokens?request=gettoken&username=username&password=password&<br>Usage: https://arcgis.example.com/arcgis/tokens/generateToken?username=username&password=password&<br>Usage: https://arcgis.example.com/arcgis/tokens/gettoken.html<br>

I had a look at the sample mentioned in this article but the MapView event does not trigger the event when token gets expired.

I know that I may refresh the token when expiration time comes but I think its better to handle this error because it more reliable and simple.

 

Thanks in advance!

Outcomes