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

  1. 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.
  2. 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.
  3. 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.

Official documentation

Have Pilae connect your identity provider

Pilae can deploy GitLab with your identity provider already connected. We agree the edition, account mapping and access tests with your team before rollout.