Federation with OIDC
Target audience
This documentation is intended for developers who want to integrate their application (Relying Party) with eIAM using OpenID Connect (OIDC) as the authentication and authorisation protocol.Important architectural note: OIDC ≠ OAuth
eIAM provides OIDC endpoints but does not operate a traditional OAuth 2.0 authorisation server.| Aspect | eIAM OIDC | Traditional OAuth |
|---|---|---|
| Protocol | OIDC (authentication + identity assertion) | OAuth 2.0 (delegated authorisation) |
| Token issuance | id_token + access_token | access_token (for resource access) + optional refresh_token |
| Scopes | openid (all other scopes are optional); cas (for CISARDA integrations) | Arbitrary application-defined scopes |
| Client Credentials Flow | Not supported (no service-to-service communication without user context) | Standard for machine-to-machine communication |
| Resource Owner Password Flow | Not supported (federated architecture, no direct credential verification) | Part of the OAuth specification |
| Device Authorisation Flow | Not supported | Optional |
| Dynamic Client Registration | Not supported (integration via dossier) | Optional (RFC 7591) |
| Realms / tenants | Single realm (Keycloak endpoints only simulated via /realm/id) | Multi-tenant capable |
In short: Your application receives a (verified) identity via OIDC with eIAM OIDC standard attributes.
Access permissions for business data (OAuth scopes for APIs) are not granted by eIAM. These are the responsibility of the respective business applications / resource servers.
Terminology (abbreviations according to the eIAM glossary)
The following eIAM-specific terms and abbreviations are used in this documentation:| Abbreviation | Designation | Explanation |
|---|---|---|
| BTB | Bundestrustbroker | Further information: BT |
| IdP | Identity Provider | (External) identity provider (see Listt of IDP |
| QoA | Quality of Authentication | Quality of authentication and QoA specification |
| HRD | Home Realm Discovery | IdP selection page (discovery/selection) Skinny HR |
eIAM-internal communication via SAML
Although your application communicates with the BTB exclusively via OIDC, the following applies internally within eIAM:- Authentication usually takes place via SAML 2.0 between the BTB and the selected IdP (AGOV, FED-LOGIN, HIN, etc.).
- The BTB transforms the SAML assertion into an OIDC access_token (JWT) and issues an id_token, meaning that a lookup at the Userinfo endpoint is not necessarily required.
- Session management, SSO, logout, QoA mapping and attribute policies are controlled on the SAML side and mapped to OIDC through configuration (SecurityPolicies, ProfileRP, QoA-Mapping).
- Token signatures, JWKS and metadata (.well-known/openid-configuration) are provided by the BTB.
- Logout is implemented via the Front-Channel (browser redirect). Back-Channel Logout is not yet supported.
- Session lifetime on the eIAM side depends on the SSO policy (maximum 12 hours) and the OIDC token TTL, not on OAuth refresh token logic.
- Error codes follow the OIDC specification but may also convey SAML Responder statuses (e.g. UserCancel, UnknownPrincipal, AuthnFailed).
OIDC flows supported by eIAM
Authorization Code Flow with Proof Key for Code Exchange (PKCE)
Use cases- BFF – "Backend for Frontend" (eIAM integration recommendation for SPAs)
- Native mobile apps
- Desktop apps
-
- Authorization Code Flow with Client Secret and PKCE
| No. | Step | Description |
|---|---|---|
| 1 | User accesses the web application | The user accesses the web application using a web browser. The web application checks access permissions and determines that prior authorisation is required. |
| 2 | Generation of the Code Verifier and Code Challenge | The web application creates a Code Verifier (Augmented Backus-Naur Form) and an additional Code Challenge derived from the Code Verifier. |
| 3 | Authorization Code Request + Code Challenge to /auth | The web application sends an Authorization Code Request and the Code Challenge to the application-specific /auth endpoint of the BTB. The client redirects the user by means of an HTTP redirection response (or other means available through the user agent) to the URI constructed for the Authentication Request. |
| 4 | Home Realm Discovery (HRD) / login context | The BTB performs Home Realm Discovery and displays the IdPs corresponding to the requested login context (eGOV or Federal context, plus optional sector-specific IdPs). |
| 5 | BTB redirect (SAML AuthnRequest) to the selected IdP | The BTB generates a signed SAML 2.0 AuthnRequest for the IdP and sends it to the user's web browser as a self-submitting form. The user's browser automatically submits the form to the IdP via an HTTP POST request using JavaScript. |
| 6 | Authentication at the IdP | The user is authenticated using an authentication method supported by the IdP. Depending on the authentication method, authentication takes place with user interaction (e.g. Access App, password) or without user interaction (e.g. Active Directory Kerberos, existing session at the IdP). |
| 7 | (SAML) response from the IdP to the BTB | The IdP issues a SAML 2.0 response to the BTB. The response contains a signed SAML assertion (the entire SAML message is also signed) with statements (claims) about the subject and the subject's attributes. The SAML response is sent to the user's web browser as a self-submitting form. |
| 8 | Attribute lookup in eIAM | The BTB verifies the validity of the SAML assertion received from the IdP. In addition to the attributes provided by the IdP, the BTB retrieves additional identity information from eIAM, which is made available as attributes. |
| 9 | Attribute aggregation | The BTB aggregates the attributes received from the IdP with those retrieved from eIAM. |
| 10 | Authorization Code Return | The BTB returns the Authorization Code in the Authentication Response and associates the values "code_challenge" and "code_challenge_method" so that they can be verified later. |
| 11 | Authorization Code + Code Verifier to /token | The web application sends the Authorization Code and Code Verifier to the application-specific /token endpoint of the BTB. The "code_challenge_method" is bound to the Authorization Code and must be used to verify the Code Verifier. |
| 12 | Validate Code Verifier and Code Challenge | The BTB calculates the Code Challenge from the received Code Verifier and compares the result with the Code Challenge previously received at the /auth endpoint, after applying the transformation specified by "code_challenge_method". If the values do not match, the BTB returns the error message "invalid_grant" to the web application in the Authentication Response. |
| 13 | ID Token, Access Token or Refresh Token | If the values match during validation, the BTB returns an ID Token, Access Token or Refresh Token in JWT (JSON Web Token) format to the web application in the Authentication Response. |
| 14 | Authentication and authorisation in the web application | The web application validates the ID Token, Access Token or Refresh Token issued by the BTB, authorises the user's access to the resource (based, among other things, on the information contained in the JSON Web Token) and, if successful, creates a user session tracked by a cookie. The user's web browser is then redirected either to a predefined URL within the web application or to the URL originally requested by the user (in request 1), as indicated in the Relay State. |
See also: RFC 7636 - Proof Key for Code Exchange by OAuth Public Clients
Authorization Code Flow with Client Secret
Reference: The OAuth 2.0 Authorization FrameworkUse cases
- tbd
-
- Authorization Code Flow with Proof Key For Exchange (PKCE)
| No. | Step | Description |
|---|---|---|
| 1 | User accesses the web application | The user accesses the web application using a web browser. The web application checks access permissions and determines that prior authorisation is required. |
| 2 | Authorization Code Request to /auth | The web application sends an Authorization Code Request to the application-specific /auth endpoint of the BTB. The client redirects the user by means of an HTTP redirection response (or other means available through the user agent) to the URI constructed for the Authentication Request. |
| 3 | Home Realm Discovery (HRD) / login context | The BTB performs Home Realm Discovery and displays the IdPs corresponding to the requested login context (eGOV or Federal context, plus optional sector-specific IdPs). |
| 4 | eIAM BTB redirect (SAML AuthnRequest) to the selected IdP | The BTB generates a signed SAML 2.0 AuthnRequest for the IdP and sends it to the user's web browser as a self-submitting form. The user's browser automatically submits the form to the IdP via an HTTP POST request using JavaScript. |
| 5 | Authentication at the IdP | The user is authenticated using an authentication method supported by the IdP. Depending on the authentication method, authentication takes place with user interaction (e.g. Access App, password) or without user interaction (e.g. Active Directory Kerberos, existing session at the IdP). |
| 6 | (SAML) response from the IdP to the BTB | The IdP issues a SAML 2.0 response to the BTB. The response contains a signed SAML assertion (the entire SAML message is also signed) with statements (claims) about the subject and the subject's attributes. The SAML response is sent to the user's web browser as a self-submitting form. |
| 7 | Attribute lookup in eIAM AM | The BTB verifies the validity of the SAML assertion received from the IdP. In addition to the attributes provided by the IdP, the BTB retrieves additional identity information from eIAM IDM, which is made available as attributes. When eIAM Access Management is used, the Trustbroker retrieves the user attributes required for Access Management at runtime from eIAM Access Management (an eIAM component). The user is identified using their identity reference pointing to the IdP in order to determine the user's eIAM account. The user is then searched for using this identity reference in a specific Access Client or in all Access Clients. |
| 8 | Attribute aggregation | The BTB aggregates the attributes received from the IdP with those retrieved from the eIAM Root Client (and the eIAM Access Client when eIAM AM is used). |
| 9 | Authorization Code Return | The BTB issues an Authorization Code in the Authentication Response and sends it to the web application. |
| 10 | Authorization Code + Application Credentials to /token | The web application sends the Authorization Code, ClientID and Client Secret (the latter is defined by eIAM and provided to the customer during the integration project) to the application-specific /token endpoint of the BTB. |
| 11 | Validate Application Credentials | The BTB compares the received ClientID and Client Secret with the ClientID and Secret stored in the eIAM configuration for this application-specific endpoint. If the values do not match, the BTB returns an error message to the web application in the Authentication Response. |
| 12 | ID Token, Access Token or Refresh Token | If the values match during validation, the BTB returns an ID Token, Access Token or Refresh Token in JWT (JSON Web Token) format to the web application in the Authentication Response. |
| 13 | Authentication and authorisation in the web application | The web application validates the ID Token, Access Token or Refresh Token issued by the BTB, authorises the user's access to the resource (based, among other things, on the information contained in the JSON Web Token) and, if successful, creates a user session tracked by a cookie. The user's web browser is then redirected either to a predefined URL within the web application or to the URL originally requested by the user (in request 1), as indicated in the Relay State. |
Authorization Code Flow with Client Secret and PKCE
Use cases- tbd
-
- Authorization Code Flow with Client Secret
| No. | Step | Description |
|---|---|---|
| 1 | User accesses the web application | The user accesses the web application using a web browser. The web application checks access permissions and determines that prior authorisation is required. |
| 2 | Generation of the Code Verifier and Code Challenge | The web application creates a Code Verifier (Augmented Backus-Naur Form) and an additional Code Challenge derived from the Code Verifier. |
| 3 | Authorization Code Request + Code Challenge to /auth | The web application sends an Authorization Code Request and the Code Challenge to the application-specific /auth endpoint of the BTB. The client redirects the user by means of an HTTP redirection response (or other means available through the user agent) to the URI constructed for the Authentication Request. |
| 4 | Home Realm Discovery (HRD) / login context | The BTB performs Home Realm Discovery and displays the IdPs corresponding to the requested login context (eGOV or Federal context, plus optional sector-specific IdPs). |
| 5 | eIAM BTB redirect (SAML AuthnRequest) to the selected IdP | The BTB generates a signed SAML 2.0 AuthnRequest for the IdP and sends it to the user's web browser as a self-submitting form. The user's browser automatically submits the form to the IdP via an HTTP POST request using JavaScript. |
| 6 | Authentication at the IdP | The user is authenticated using an authentication method supported by the IdP. Depending on the authentication method, authentication takes place with user interaction (e.g. Access App, password) or without user interaction (e.g. Active Directory Kerberos, existing session at the IdP). |
| 7 | (SAML) response from the IdP to the BTB | The IdP issues a SAML 2.0 response to the BTB. The response contains a signed SAML assertion (the entire SAML message is also signed) with statements (claims) about the subject and the subject's attributes. The SAML response is sent to the user's web browser as a self-submitting form. |
| 8 | Attribute lookup in eIAM AM | The BTB verifies the validity of the SAML assertion received from the IdP. In addition to the attributes provided by the IdP, the BTB retrieves additional identity information from eIAM IDM, which is made available as attributes. When eIAM Access Management is used, the Trustbroker retrieves the user attributes required for Access Management at runtime from eIAM Access Management (an eIAM component). The user is identified using their identity reference pointing to the IdP in order to determine the user's eIAM account. The user is then searched for using this identity reference in a specific Access Client or in all Access Clients. |
| 9 | Attribute aggregation | The BTB aggregates the attributes received from the IdP with those retrieved from the eIAM Root Client (and the eIAM Access Client when eIAM AM is used). |
| 10 | Authorization Code Return | The BTB returns the Authorization Code in the Authentication Response and associates the values "code_challenge" and "code_challenge_method" so that they can be verified later. |
| 11 | Authorization Code + Application Credentials + Code Verifier to /token | The web application sends the Authorization Code, Application Credentials and Code Verifier to the application-specific /token endpoint of the BTB. The "code_challenge_method" is bound to the Authorization Code and must be used to verify the Code Verifier. |
| 12 | Validate Application Credentials, Code Verifier and Code Challenge | The BTB calculates the Code Challenge from the received Code Verifier and compares the result with the Code Challenge previously received at the /auth endpoint, after applying the transformation specified by "code_challenge_method". The BTB also compares the received ClientID and Client Secret with the ClientID and Secret stored in the eIAM configuration for this application-specific endpoint. If the values do not match, the BTB returns an error message to the web application in the Authentication Response. |
| 13 | ID Token, Access Token or Refresh Token | If the values match in both validations, the BTB returns an ID Token, Access Token or Refresh Token, depending on the flow, in JWT (JSON Web Token) format to the web application in the Authentication Response. |
| 14 | Authentication and authorisation in the web application | The web application validates the ID Token, Access Token or Refresh Token issued by the BTB, authorises the user's access to the resource (based, among other things, on the information contained in the JSON Web Token) and, if successful, creates a user session tracked by a cookie. The user's web browser is then redirected either to a predefined URL within the web application or to the URL originally requested by the user (in request 1), as indicated in the Relay State. |
Example of a JWT
The definition of the standard attributes and therefore the guaranteed content of a JWT is provided under OIDC: Standard identifier and attributes.
Metadata URL
| Environment | Metadata URL |
|---|---|
| REF | |
| ABN | |
| PROD |
HRD-Hint
Link to the HRD-Hint customer documentation (Confluence)Special cases
BFF – "Backend for Frontend" for SPA (Single Page Application)
eIAM does not officially support the direct integration of SPAs (public clients in the browser). This is due to security risks associated with token handling in the browser (XSS, token leakage in logs/history, lack of secure storage for refresh_token), which are not covered by the eIAM security policies. The required architectural pattern is Backend for Frontend (BFF): The SPA delegates the OIDC flow to a server-side BFF (confidential client), which manages the tokens securely and grants the SPA access only through a hardened session-based interface (HttpOnly Secure cookie, CSRF protection).Comparison: direct SPA client and BFF
| Feature | SPA (Direct / Public Client – not supported) | SPA via BFF (supported pattern) |
|---|---|---|
| OIDC Flow | Authorization Code Flow with PKCE (`S256`) | Authorization Code Flow with `client_secret_post` / `client_secret_basic` (at the BFF) |
| Client authentication | No secret – proof of possession via `code_verifier` | `client_id` + `client_secret` (at the BFF, securely stored server-side) |
| Token storage | Browser (Memory, LocalStorage, SessionStorage) – risk (XSS) | Only at the BFF (server-side); the SPA receives only a session cookie |
| Refresh Token | Not supported (PKCE + Refresh Token = security vulnerability according to the specification) | Supported (at the BFF, transparent to the SPA) |
| Logout / session synchronisation | Complicated (Front-Channel iframe, tab synchronisation, prompt=none) | Reliable server-side handling (BFF terminates the session and invalidates the cookie) |
| Token forwarding to API | Directly from the browser (Access Token in the Authorization header) | Via BFF proxy (BFF adds the Access Token, SPA only uses the cookie) |
In summary:
The BFF moves client authentication (client_secret), token persistence, refresh handling and logout orchestration from the insecure browser context to the trusted application server. This turns the SPA into a pure presentation layer without direct contact with OAuth artefacts – the only operating model approved by eIAM for browser-based frontends.
Pattern: Misuse of ID Tokens in SPAs (Single Page Applications) with microservices
In this pattern, the application typically runs as a Single Page Application in the browser and calls the underlying microservices via REST APIs protected by the OAuth 2.0 mechanism.
In this case, the id_token is used for API authorisation of the supporting microservices. This constitutes misuse of the OIDC / OAuth 2.0 concept, which we do not recommend and do not support if problems arise on the application side.
eIAM OIDC is configured to use the Authorization Code Flow. To achieve an appropriate level of security, PKCE must also be used in this case.
-
- Example of ID Token Abuse in an SPA with Microservices
Pattern: Authorisation Server for SPAs (Single Page Applications) with microservices
In this pattern, an Authorisation Server is introduced to issue and manage Access Tokens valid within the application's domain.
The Authorisation Server is the responsibility of the application (or application cluster). At present, eIAM does not provide a service offering this functionality.
-
- Example of an Authorization Server for an SPA with Microservices
Native mobile applications
In general, eIAM does not support the integration of native mobile applications.Technically, integration is possible if the application does not use an embedded web browser.
This ensures that the AGOV access App or FED-LOGIN Access App can be launched.
Otherwise, the restrictions already mentioned for SPAs must also be taken into account for native mobile apps.