AnsweredAssumed Answered

identity manager and local storage

Question asked by dbecker88 on May 2, 2013
Latest reply on Jun 27, 2017 by TruthOf42
followed the example on how to persist identity manager info using local storage or cookie.
http://developers.arcgis.com/en/javascript/jssamples/widget_identitymanager_client_side.html

I've discovered a problem, occasionally you come back to the JS app using FireFox and you are prompted with identityManager signIn dialog. You enter valid credentials, the modal signIn disappears, then re-appears with an error: "this value is required" for the password field.


I was finally able to reproduce the problem, you can perform these steps with the above sample:

1. login to js app normally by supplying valid credentials
2. close the tab or browser; dojo.addOnUnload() stores the current, valid, credential object in localStorage as a string
3. locate the string in localStorage (i used SQLite Manager extension in FF)
4. change a single character in the token, you essentially in-validate the token
5. new tab in FF, try to login to the js app; you will be presented with the password error on the signIn dialog

Step 5 above, firebug never shows a call to the token service to obtain a new token. After pressing the OK button on the signIn dialog, all the layers are attempting to be accessed with a URL qString like so:
https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/FeatureServer/0?f=json&token=theInvalidTokenYouEdited

I assume the token service is not called because the token that was loaded from localStorage is not expired, it's just invalid.

any advice on how to force identityManager to acquire a new token when the token in localStorage is invalid?

thanks.

Outcomes