Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There can be a scenario where a particular widget needs are scenarios that require a widget to access the user information of current the user who is currently logged in user. For that, this purpose an API has been introduced to the widget developer via the base widget component.

Follow To access user information, follow the steps mentioned below to access user information. Please note that this below:

Info

This API currently exposes only the username of the current user.

...

NOTE: This guide assumes that you already have a widget which is deployable in dashboard portal.

...

Tip
iconfalse
titleBefore you begin:

A widget that can be deployed in the Dashboard Portal must already exist.


  1. Ensure that your widget is extended from the base widget provided by the dashboard portal. If not please refer “For more information, see Extending from base widget component.
  2. Call the following method to get the user information.

    Code Block
    languagejs
    const userInfo = super.getCurrentUser();

...

Info

This feature is demonstrated by the sample widget named UserInfo that is shipped with WSO2 SP by default. You can view the source code of

...

this widget here.