Authentication Token

An Authentication Token can be used to securely communicate with a service. It's a JWT token that contains the fields listed below.

An integration for the service must be defined in the Frontend Tokens section in EMS Admin. Calling the getter function with the name of the integration will return a promise that will be resolved with an Authentication Token.

This utility works in iframes as well, but the UI Kit must be present on top window otherwise the promise won't resolve. The promise will be rejected if top window's domain is not whitelisted in Suite configuration.

Usage

Name Description
window.e.utils.v2.auth.getAuthenticationToken(integrationName) The authentication token utility is used to retrieve an Authentication Token.

Parameters

Name Type Description
integrationName The name of the integration to get the Authentication Token for

Return value

Type Description
A promise that resolves to the Authentication token

JWT Fields

The JWT decoded Authentication Token contains the following fields:

Name Type Description
adminId The adminId of the currently logged in admin
auditContext Contains further information about the session
customerId The customerId of the currently logged in customer
environment The name (domain) of the current environment
exp Expiration time (JWT token)
iss Token issuer (JWT token)
language Preferred language of the currently logged in admin
msid Master session ID
sapGlobalUserId SAP Global User ID

Example

window.e.utils.v2.auth.getAuthenticationToken('myIntegration').then(token => {
  return getDataFromBackend(token);
});