GitLab SSO with Keycloak (OIDC)
Use GitLab’s generic OIDC provider with Keycloak on Self-Managed Free, Premium or Ultimate; do not apply instance configuration to GitLab.com.
Last updated
On this page (5)
GitLab · Keycloak · OIDC
Before you start
- GitLab Self-Managed administrator.
- Keycloak realm and client administration.
- Recoverable GitLab admin path.
Configure sign-in
- Make a dedicated Keycloak authorization-code client; register exactly the redirect_uri in GitLab’s provider configuration, normally /users/auth/openid_connect/callback on the public host.
- Configure GitLab OmniAuth openid_connect with discovery, the Keycloak realm issuer, scopes and client credentials. Use the stable OIDC sub for identity binding rather than a mutable email claim.
- Review existing OmniAuth identities and controlled linking; explicitly decide who may create an account. Assign GitLab group/project access separately unless a supported lifecycle integration has been configured.
Verify the result
- Confirm existing users retain the same GitLab account and that unauthorized users cannot enroll. Test offboarding for browser sessions, PATs, SSH keys and runners separately.
- Treat OIDC as sign-in, not proof of SCIM or group sync entitlement. GitLab.com group SAML has its own Premium/Ultimate setup.
