Identity provider configuration

The Token Server has no user management. The Token Server depends on external identity providers (IdP) to identify a user. The Token Server supports multiple integrations with identity providers out of the box. Custom integrations are also supported.

Go to Configuration and then to Identity providers to configure identity providers in the admin console.

General configuration

The following properties can be set for each type of identity provider:

  • Type: the type of this identity provider. The type cannot be changed later.
  • Name: a human readable name of the identity provider. This name is not shown to the end user, only to administrators.
  • Default: an identity provider can be assigned to an application. When no identity provider is specified for an application, the default identity provider is used.
  • Enabled: flag to enable/disable this identity provider.

Configure a SAML Identity Provider

Add saml IdP

By default the endpoints required for SAML in the Token Server are disabled. These endpoints should be enabled via Docker Compose environment variable TOKEN_SERVER_ENGINE_IDP_SAML_SP_ENABLED_BOOLEAN to use the SAML IdP integration.

When the SAML IdP functionality is used the Token Server acts as a SAML service provider. The metadata of the service provider can be configured via Docker Compose environment variables. In the SAML IdP the Token Server has to be configured as service provider. The metadata endpoint of the Token Server is /oauth/saml/metadata.

The Entity ID must be configured in the Token server for a SAML IdP. The Entity ID in the configuration of Token Server should be equal to the Entity ID in the metadata of the IdP.

There are two options to specify the IdP metadata:

  1. The metadata can be configured by specifying the Metadata URI of the SAML IdP.
  2. By specifying the complete XML of the metadata. When the URI is specified the metadata will be reloaded frequently. The Token Server supports multiple certificates in the metadata in order to migrate to a new certificate smoothly.

By default only the user id of the user is mapped based on the name id available in the SAML assertion. By adding an attribute mapping more user attributes from the SAML assertion can be used. When creating an attribute mapping both the Name or FriendlyName of a SAML attribute can be used. Example:

SAML attribute mapping

The Token Server supports free format attribute names. All attributes (including the non default ones) are available in the token validation response and in the consent template. A set of default attributes is available that can lead to different behavior in the Token Server:

  • userId
  • authenticationLevel
  • firstName
  • lastName
  • email
  • phoneNumber
  • languageCode

Configure a Header Identity Provider

When using the header IdP, the identity of the end-user must be provided via HTTP-headers to the Token Server. The headers must be set by a trusted entity in the network. For example a WebSEAL instance or another kind of reverse proxy. This entity is responsible for stripping headers which are set by untrusted parties (e.g. coming from the internet).

Headers can be mapped to user attributes based on the configured attribute mapping. A default attribute mapping is available out of the box. Only mappings that differ from the default mapping have to be configured. A non standard user attribute can also be defined using an attribute mapping.

Default mapping:

Header User attribute Description
userId userId The identifier of the user
authenticationLevel authenticationLevel A value indicating the authentication level of the user, this value is free format and should be interpreted by external systems
firstName firstName First name of the user
lastName lastName Last name of the user
email email The email address of the user
phoneNumber phoneNumber The phone number of the user
languageCode localeCode The locale of the user, used to localize the pages served by the Token Server.

A language code can also be provided via a cookie value. When the cookie is specified it will overrule the language code set in the header. The cookie name used for to overrule the language code header and the default language code can be set via the following Docker Compose environment variables.

Configure a Two way OTP Identity Provider

A Two way One Time Password (OTP) IdP generates two random strings. The first one is generated in the session on the mobile device. A second one is generated when the users starts a new session on a system that knows the identity of the user, for example a self service environment. An api is available for this system to interact with the Token Server. By entering the generated values in the different sessions a user can be linked to a mobile device.

A description on how to configure the access to the api can be found in the API configuration topic.

Optionally a scope validation service can be used to verify that a user has access to the requested scopes. A scope validation service can be configured via Docker Compose environment variables. This is only the first step of enabling scope validation services. For the second part of the scope validation configuration see the scopes topic.

Attribute mappings are not used in this IdP.

Configure a One Time Password Identity Provider

The One Time Password IdP is intended to be used with a QR code. First of all the user should login to a system that knows the identity of a user. This system can use an api to fetch a 25 digits long secret from the Token Server. This secret has to be entered on the mobile device, manually or via a QR code, to connect an end-user account to his device.

Attribute mappings are not used in this IdP.

Configure an OAuth Identity Provider

Add OAuth IdP

The Token Server can act as an OAuth client for an identity provider that acts as an OAuth authorization server. The Token Server then uses the OAuth authorization code flow to obtain an access token and uses that access token to get user information.

The following properties can or must be set for the OAuth Identity Provider:

Property Example Required Description
Client ID jeguighreuwih8792459​uht893​ Yes The identifier for the Token Server in the OAuth IdP.
Secret fjerfr9uf089rf908f90​refeef​ Yes The secret for the Token Server in the OAuth IdP.
Authorization URL https://example.com/oauth/authorize Yes URL to start the authorization without request parameters. These are added by the Token Server.
Token URL https://example.com/oauth/token Yes URL to exchange the access grant for an access token without request parameters. These are added by the Token Server. The URL is called via HTTP POST. The client id and secret are sent via the HTTP Authorization header (Basic authentication).
Profile URL https://example.com/me Yes URL for an OAuth resource call that returns a user profile. The URL is called via HTTP POST. The access token is sent via the HTTP Authorization header with a Bearer token.
Scopes profile No Scopes that are needed for getting the user profile. Multiple scopes must be separated by a space. An empty value is allowed.

The host, protocol and context are taken from a Docker Compose environment variable TOKEN_SERVER_COMMON_ENGINE_BASE_URI and must denote the public hostname on which the Token Server instance can be reached from the internet. The context root of the Token Server engine can optionally be set via Docker Compose environment variable: TOKEN_SERVER_COMMON_ENGINE_CONTEXT_ROOT.

During the OAuth authorization flow the user is redirected back from the OAuth IdP to the Token Server. This redirect URL is the engine base URI + the engine context root + /oauth-idp/callback. Example: https://token-server.example.com/oauth/oauth-idp/callback.

Attribute mappings are currently not supported in this IdP. The Token Server expects the profile in the following structure to extract the user identifier:

{
  "userId" : "user-1234"
}

Configure a custom Identity Provider

For a custom IdP only general IdP properties can be set via the Token Server admin console. Other configuration must be set as described in the documentation of this custom identity provider.

The type of the custom IdP is set by specifying its Spring bean name via a Docker Compose environment variable.