Select to view content in your preferred language

How to enable 'Keep Me Signed In' for oauth.

388
0
10-12-2022 01:21 PM
jelkinsiv
New Contributor

I am trying to enable to the ability to remember the user to prevent them to need to constantly login. All the images and docs have that little option, but when I run the code its missing. I am running JS 3.41 and running the work flow like this:

var appId = "APP_ID"
var info = new esri.arcgis.OAuthInfo({
     appId: appId,
     portalUrl: "PORTAL_URL",
     popup: false
})
esri.IdentityManager.registerOAuthInfos([info]);
esri.IdentityManager.checkSignInStatus(info.portalUrl + '/sharing').then(() => {
    // load my map
}).otherwise(() => {
          esri.IdentityManager.getCredential(info.portalUrl + "/sharing", {
          oAuthPopupConfirmation: false
     })
})
0 Kudos
0 Replies