I have a widget in WAB Dev Edition which uses the `IdentityManager` to manage the user authentication.
The problem is that my WAB Dev Edition requires me to be logged in so the widget always receives an already logged in user. I also implemented a log out function via `IdentityManager.destroyCredentials()` but on page reload the WAB asks me to log in. So I never get to test my authentication code.
I have a custom widget that uses IdentityManager. I have a button to let the user sign in which uses OAuthInfo with a popup. This is how I call it
const info = new ArcGISOAuthInfo({
appId: theAppId,
popupCallbackUrl: thePopupCallbackUrl,
popup: true,
portalUrl: this._portalUrl
});
esriId.registerOAuthInfos([info]); //this is the IdentityManager
esriId
.getCredential(info.portalUrl, {
oAuthPopupConfirmation: true
})
.then(
lang.hitch(this, function () {
this._portal = new arcgisPortal.Portal(this._portalUrl);
this._portal
.signIn()
.then(
// do everything using the Identity manager
The popup allows me to either use my existing account that I'm running WAB DE or to use another account.
I have a button to sign out of the portal, but it uses Portal.signOut. I have to use this button when I launch my app from WAB DE since it automatically signs me in.