Grafana SSO with Keycloak (OIDC)
Use Grafana Generic OAuth with Keycloak and map a specific realm or client role vocabulary.
Last updated
On this page (5)
Grafana · Keycloak · OIDC
Before you start
- Keycloak realm and Grafana admin.
- HTTPS and a dedicated confidential client.
Configure sign-in
- Create an OIDC client with Standard Flow enabled and the precise https://<grafana-host>/login/generic_oauth callback.
- Configure [auth.generic_oauth] with the realm authorization, token and userinfo URLs, client credentials and openid profile email scopes.
- Configure Keycloak to emit the intended role claim in the token or userinfo; write role_attribute_path against that exact claim shape, and reject unmapped users if required.
Verify the result
- Validate same-account login after a profile rename, least-privilege Grafana roles and which data sources the user can actually query.
- Verify any separately licensed team sync or data-source permissions rather than inferring them from role claims. Test local and IdP logout and active sessions after access removal.
