GitLab SSO with Authentik (OIDC)
Set up Authentik as an OpenID Connect provider for GitLab Self-Managed, with deliberate signup controls and existing account linking.
Last updated
On this page (5)
GitLab · Authentik · OIDC
Before you start
Use the Self-Managed OmniAuth OpenID Connect provider, available on Free, Premium and Ultimate. You need permissions to configure both services, the public GitLab URL, and a recoverable GitLab admin login independent of Authentik.
Configure sign-in
- Create an Authentik application with a confidential OAuth2/OpenID provider. Allow the exact redirect
https://<gitlab-host>/users/auth/openid_connect/callback, then restrict the application with an access policy. Use the issuer shown by discovery for this provider, not the discovery-document URL itself. - Configure the GitLab
openid_connectOmniAuth provider using its instructions for your installation type. Set the issuer, client credentials, matching redirect and discovery. Use the OIDCsubforuid_field; scope requests toopenid,profileandemailas needed. - Keep automatic linking and registration limited until you have tested an existing user and a brand-new one. Sign in to the existing GitLab account first and use its connected-account settings when linking. Approve access to projects and groups separately from access to the Authentik application.
Verify the result
- An existing user sees their original projects and an unauthorized Authentik account cannot enroll. Try a pilot profile rename and confirm the linked GitLab identity does not change.
- Remove a pilot’s Authentik access and check browser sessions, access tokens and SSH separately. Write down what GitLab administrators must revoke; the OIDC provider is not directory or SCIM provisioning.
