Hi there,
I've followed few sample on OAuth and IdentityManager and successfully implemented it into our internal portal, but each time a user closes the window, he has to authenticate himself again when accessing the application. After inspecting the browser storage data, I've noticed the OAuth info is stored in he sessionStorage rather than localStorage
Once user is authenticated and redirected from ESRI Login Page, I'm using the following function to finalize the login.
if (window.location.hash) { window.opener.require('esri/kernel').id.setOAuthResponseHash(window.location.hash) window.close() }
But how can I tell the IdentityManager to use the localStorage instead of sessionStorage?
Thank you.
ok, so by reverse engineering the js api for IdentityManager, I've added the
&persist=true
to the response hash.
if (window.location.hash) { window.opener.require('esri/kernel').id.setOAuthResponseHash(window.location.hash + '&persist=true') window.close() }
And that has forced the IdentityManager to store it in the localStorage rather than the sessionStorage.
Interesting thing is, that the ESRI's login popup window doesn't have 'Remember Me' checkbox for enterprise logins, but it does for the standard login. I believe this would've solved our issue but at least I have the workaround.
Excellent!!!
Where do you put this code at. I want to use it for my node.js app