Authentication widget

577
5
06-16-2022 11:53 PM
Status: Open
henrilebon974
New Contributor III

Hello ESRI,

Could you share the code of the widget below please. it is is the builder (top right). I think it could be pretty good to have a very good authentication widget in our Experience Builder Apps.

Thanks.

henrilebon974_0-1655448653051.png

 

Tags (1)
5 Comments
DougLogsdon2

@henrilebon974,

After digging, I found this (undocumented) component:

import { UserProfile} from 'jimu-ui';

<UserProfile
  className="left esri-header-account-image"
  portalUrl={this.props.portalUrl}
  user={this.props.user}
  helpUrl={this.props.config.helpUrl || this.props.portalUrl} >
</UserProfile>

It will pull the current user, icon, etc from the active session and update through state changes.

For initial login, use the SessionManager:

onSigninClickHandler = () => {
  let sm = SessionManager.getInstance();
  sm.signIn();
}

Best of luck!

 

henrilebon974

Thank a lot Doug. I'm going to try that.

SaiBharadwaj

Hi. Can you share methodology how to implement this. Thanks

henrilebon974

Hello,

 

You can add it in a widget like this.

henrilebon974_0-1657898028858.png

 

SaiBharadwaj

Thank you very much @henrilebon974 . I will try to implement this.