Identity widget
An identity widget is a small rectangular representation of a user's authentication status and identity. It shows an authenticated user's name and avatar, or allows an unauthenticated user to log in.
Example:
Embedding
Assuming that the widget loader is included in the page, an identity widget may be embedded as follows:
<div class="drl-widget drl-identity"></div>
Attributes
Attribute | Description |
---|---|
drl-logout-enabled |
Controls whether users are given the option to log out of an authenticated session. Set to true to allow this. |
drl-request-password-enabled |
Controls whether users are given the option to request a password reset email. Set to true to allow this. |
drl-token |
An optional OAuth token. An OAuth token may be obtained by using a standard service account or by using the custom delegated login API. |
id |
An optional identifier for the widget. The id is useful to determine which widget sent a client side event in case there are multiple widgets on the page. Please make sure to use a unique ID for each widget present on the page. |
drl-dark-mode |
If set to true , renders the identity widget for use on a dark background. The value is optional. If omitted, the widget will be rendered for use on a light background. |
drl-suppress-3rdparty-buttons |
Suppresses the display of third party login buttons (Google, Microsoft) if set to true . This attribute is optional. If omitted, the third party login buttons will be displayed. |
Client side events
The identity widget is able to emit the following client-side events.
Event | Fired if | Payload |
---|---|---|
INITIALIZED |
The widget has successfully started up. | An optional user object. |
AUTHENTICATED |
The user has successfully authenticated. | None. |
UNAUTHENTICATED |
The identity of the user is not known. | None. |
LOGGED_OUT |
The user was logged out due to clicking the “Log out” button. | None. |
Last updated on