Keycloak integration guides
Connect your apps, the tools you run and your identity providers to Keycloak. Client settings, code, mappers and common errors for each.
Each guide shows the settings on both sides, the code or configuration to add, how groups and roles reach the other side, and the errors people hit most often. Your tenant runs upstream Keycloak, so the guides also work with a Keycloak you run yourself.
The guides use https://auth.example.com/realms/acme as the realm URL. Replace auth.example.com with your RealmDeploy hostname and acme with your realm.
Add login to your app
- Add Keycloak login to a Next.js appAdd Keycloak login to a Next.js App Router app with Auth.js, protect a route handler with jose, and log out of Keycloak too.TypeScriptJavaScriptOIDC
- Add Keycloak login to a React appAdd Keycloak login to a React single-page app built with Vite, using oidc-client-ts and react-oidc-context with the code flow and PKCE.TypeScriptJavaScriptOIDC
- Add Keycloak login to an Angular appAdd Keycloak login to an Angular 22 app with angular-oauth2-oidc, the standalone provideOAuthClient API, and the code flow with PKCE.TypeScriptJavaScriptOIDC
- Add Keycloak login to a Vue appAdd Keycloak login to a Vue 3 single-page app built with Vite, using oidc-client-ts with the authorization code flow and PKCE.TypeScriptJavaScriptOIDC
- Add Keycloak login to a Node.js Express appSign users in to an Express app with Keycloak using openid-client v6 and sessions, protect API routes with jose, and log out of Keycloak.TypeScriptJavaScriptOIDC
- Add Keycloak login to a Spring Boot appSign users in to a Spring Boot 4 app with Keycloak through Spring Security's OAuth2 client, protect a JWT API with realm roles, and log out of Keycloak.JavaOIDC
- Add Keycloak login to a Quarkus appSign users in to a Quarkus app with Keycloak using quarkus-oidc in web-app mode, protect a REST API with bearer tokens and realm roles, and log out.JavaOIDC
- Add Keycloak login to an ASP.NET Core appSign users in to an ASP.NET Core minimal API app with Keycloak through the OpenID Connect handler, protect an API with JwtBearer, and log out of Keycloak.C#OIDC
- Add Keycloak login to a Django appAdd Keycloak login to Django with mozilla-django-oidc, log users out of Keycloak too, and protect a REST API by validating access tokens with PyJWT.PythonOIDC
- Add Keycloak login to a FastAPI appValidate Keycloak access tokens in FastAPI with PyJWT and JWKS, add browser login with Authlib, and log users out of Keycloak.PythonOIDC
- Add Keycloak login to a Go appSign users in to a Go web app with Keycloak using go-oidc and x/oauth2, verify access tokens in API middleware, and log users out.GoOIDC
- Add Keycloak login to a Laravel appSign users in to a Laravel 13 app with Keycloak through Socialite and the SocialiteProviders driver, protect API routes with firebase/php-jwt, and log out.PHPOIDC
Single sign-on for the tools you run
- Keycloak SSO for GrafanaSign in to Grafana with Keycloak through Generic OAuth, map Keycloak groups to Grafana roles with JMESPath, and log out of both at once.OIDCDevOps
- Keycloak SSO for GitLabSign in to GitLab Self-Managed with Keycloak through the OmniAuth OpenID Connect provider, and use Keycloak groups for admin and external users.OIDCDevOps
- Keycloak SSO for Argo CDSign in to Argo CD with Keycloak over OpenID Connect, send Keycloak groups in a groups claim, and map them to Argo CD roles in argocd-rbac-cm.OIDCKubernetesDevOps
- Keycloak SSO for HashiCorp VaultSign in to the Vault UI and CLI with Keycloak through Vault's OIDC auth method, and give Keycloak groups Vault policies with external groups.OIDCSecurityDevOps
- Keycloak SSO for KubernetesLet kubectl users sign in to a Kubernetes cluster with Keycloak, map Keycloak groups to RBAC, and see what EKS and AKS let you configure.OIDCKubernetesCloud
- Keycloak SSO for AWS IAM Identity CenterUse Keycloak as the external SAML 2.0 identity provider of AWS IAM Identity Center, with an email NameID, and create the matching users in Identity Center.SAMLCloud
- Keycloak SSO for JenkinsSign in to Jenkins with Keycloak through the OpenId Connect Authentication plugin, map groups to Matrix or Role-based permissions, and use JCasC.OIDCDevOps
- Keycloak SSO for SonarQubeSign in to SonarQube Server or Community Build with Keycloak over SAML, with login, name, email and group attributes for just-in-time group sync.SAMLDevOps
- Keycloak SSO for NextcloudSign in to Nextcloud with Keycloak through the official OpenID Connect user backend app (user_oidc), with group provisioning and logout from both.OIDCCollaboration
- Keycloak SSO for PortainerSign in to Portainer with Keycloak through its Custom OAuth provider, with user provisioning and, in Business Edition, teams from a groups claim.OIDCDevOps
Connect an identity provider
- Connect Microsoft Entra ID to Keycloak (OIDC)Let users sign in to your Keycloak realm with their Microsoft Entra ID work account over OpenID Connect, and map Entra groups to Keycloak groups.OIDC
- Connect Microsoft Entra ID to Keycloak (SAML)Broker Microsoft Entra ID logins into your Keycloak realm over SAML 2.0 with a non-gallery enterprise app, signed assertions and Entra groups mapped to Keycloak groups.SAML
- Connect Google Workspace to KeycloakLet your Google Workspace users sign in to your Keycloak realm, limited to your own domain, and learn how to bring Google groups along.OIDCSAML
- Connect Okta to KeycloakBroker Okta logins into your Keycloak realm over OpenID Connect, with Okta's groups claim mapped to Keycloak groups.OIDC
- Connect GitHub to KeycloakLet users sign in to your Keycloak realm with GitHub through a GitHub OAuth App, and what to do when only members of one GitHub organization may get in.OAuth
- Connect Active Directory to Keycloak (LDAP)Federate Microsoft Active Directory users and groups into your Keycloak realm over LDAPS, read-only, with password checks against your domain controllers.LDAP