Keycloak OpenID Connect identity provider and mappers

You need three values from the developer console: the client ID, the client secret (web server apps only) and the redirect URI you registered. Everything else comes from the discovery document at https://identity.dazr.eu/.well-known/openid-configuration.

Keycloak (identity brokering)

If your apps already sign in through Keycloak, add Dazr Identity as an identity provider. Keycloak then shows “Sign in with Dazr Identity” on its own login page and your apps keep talking to Keycloak. In the Keycloak admin console of your realm, open Identity providers, add OpenID Connect v1.0 and fill in:

SettingValue
Aliasdazr (the redirect URI to register at Dazr is https://keycloak.example.eu/realms/<realm>/broker/dazr/endpoint)
Display nameDazr Identity
Discovery endpointhttps://identity.dazr.eu/.well-known/openid-configuration
Client authenticationClient secret sent as basic auth
Client ID and Client secretfrom the Dazr developer console (web server app)
Use PKCEon, method S256
Validate signatureson, with Use JWKS URL on and JWKS URL https://identity.dazr.eu/oauth/jwks
Scopesopenid profile email, plus organisations if you map organisations below
Backchannel logoutoff: Dazr Identity has no back-channel logout. Sign-out goes through the browser to https://identity.dazr.eu/oauth/logout.
Disable user infooff: the mappers below read the user info response
Trust emailon: Dazr only issues verified email addresses
Sync modeForce, so names and roles are updated at every sign-in

Keycloak keys the brokered account on the Dazr sub. Set the first login flow to link existing Keycloak users by email only if your realm verifies email addresses itself.

Map organisations and roles

When Keycloak brokers Dazr Identity (see the Keycloak guide), add mappers under the identity provider’s Mappers tab, with sync mode Force. Keycloak reads these paths from the user info response, and a path can name one position in a list: organisations[0] is the first organisation the person ticked. For a portal with one customer account per person that is enough; if people work for several organisations, let them tick one, or read the full list in your app.

Mapper typeClaimResult
Attribute Importerorganisations[0].idUser attribute dazr_org_id: the tenant key
Attribute Importerorganisations[0].nameUser attribute dazr_org_name
Claim to Roleorganisations[0].role, claim value ownerRealm or client role tenant_admin
Claim to Roleorganisations[0].role, claim value adminRealm or client role tenant_admin
Claim to Roleorganisations[0].role, claim value memberRealm or client role tenant_user
Claim to Roleorganisations[0].verification.status, claim value verifiedRole verified_business

Then add a User Attribute mapper for dazr_org_id to your app’s client scope in Keycloak, so your app receives the tenant key in Keycloak’s own tokens, next to the roles.

More for developers