Skip to content

Obtaining session information via API

This guide will walk you through the process of retrieving a user's session data using the Session API functionality. This feature allows to fetch information from the logged in user's session in Onegini IdP. The session information can be used to perform additional actions for the user in the ui-extension.


To successfully complete this topic guide you need to ensure following prerequisites:

  • Onegini IdP instance must to be running, for the sake of this guide we assume it's available under address
  • Onegini IdP ui-extension must to be running, for the sake of this guide we assume it's available under address
  • access to the Onegini IdP admin console
  • at least one user must be registered within the Onegini IdP instance


The Session API feature is enabled automatically when you define a base url of the ui-extension. Go to admin panel UI-Config section and enter the ui-extension url, e.g.

Retrieving user session information

To retrieve the user's session information the user must be logged in to the Onegini IdP instance. This will generate a domain cookie named idp_session_magmt_token with a session management token. You can obtain the session information using the token in the cookie.

From within the ui-extension application the cookie information can be obtained. For this both the core and the ui-extension should use the same domain. Using the cookie information the session api can be call to obtain for the user's session data.

The full api specification can be found in the Session api reference guide.



Required header parameter

  "X-Onegini-Session-Mgmt-Token": "string"

The X-Onegini-Session-Mgmt-Token must contain the session management token obtained from the cookie.


In response, you will receive the personId and subset of person related data. You can fetch the data at any time as long as user session is maintained on the idp-core side.