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 nothing if there is no authenticated user.

Example:

Identity widget

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-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.

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. None.

 

Last updated on