Zitadel SSO for self-managed GitLab

Zitadel can sign users into a self-managed GitLab instance over OpenID Connect. This page covers the Zitadel web application, redirect URIs, GitLab OmniAuth settings, group sync options and the checks that confirm the login works.

On this page

How Zitadel SSO for self-managed GitLab works

Zitadel documents sign-in to a self-managed GitLab instance as an OpenID Connect web application inside a Zitadel project, with the connection configured on the GitLab side through OmniAuth. If your organization runs its own GitLab and wants one sign-in for staff, Zitadel handles the authentication step while GitLab keeps its own role as the system of record for projects, groups, repository access and merge permissions. When a user signs in, Zitadel confirms who they are and returns an identity to GitLab, and GitLab then decides what that user may do. This split matters for access reviews: a removed Zitadel account stops new sign-ins, but project memberships and group roles still live in GitLab and must be checked there as well.

The Zitadel self-hosted GitLab guide is the basis for this setup, and it covers the Zitadel side: creating the web application in a project and recording the client ID and client secret. The GitLab side is set in the OmniAuth provider configuration of the installed GitLab. Because OmniAuth settings, provider names and option keys have changed across GitLab releases, confirm each setting against the GitLab authentication and authorization documentation for the exact version you run before you change production configuration. Treat the Zitadel guide as the starting point and the GitLab version documentation as the reference for what each key does.

Before building, decide three things with the team that owns identity: which Zitadel organization and project will hold the GitLab application, how the redirect URI will match your public GitLab hostname, and whether group membership will come from Zitadel claims or stay managed in GitLab. Each choice changes what must be tested. A mismatched redirect URI or hostname typically fails at the first sign-in, so run that test on a non-production instance first and record which user attributes GitLab receives from Zitadel.

What you need before configuring the connection

Six items need to be in place before you touch either system. Together they decide whether the Zitadel application, the GitLab OmniAuth settings and the redirect URIs can be configured once and left alone. Confirm each one with the team that owns it.

A running Zitadel instance

Confirm that Zitadel is deployed, reachable and on a release your team has chosen to run. Self-hosted Zitadel uses PostgreSQL as its database, and the supported range is PostgreSQL 14 through 18, so check the database version before you rely on the instance. Confirm which Zitadel release you will run, because the current release line is v4.19.5 and upgrades should be planned rather than applied during the SSO rollout.

Supported PostgreSQL versions
14 to 18
Self-hosting overview

A Zitadel project for GitLab

Create a dedicated project in the Zitadel organization that will hold the GitLab web application. A separate project keeps GitLab's client credentials, roles and grants apart from other applications, and it gives you one place to review who can sign in to GitLab. Decide now which organization owns the project, because it determines which users can reach the login.

A self-managed GitLab with administrator access

You need an administrator account on the GitLab instance, with shell or console access to the server for configuration changes. Confirm the GitLab edition you run, since the OmniAuth settings and group sync options you plan to use should be checked against your edition. Keep a local administrator account that does not depend on SSO, so you can recover if the OIDC settings break.

Public HTTPS hostnames for both systems

Zitadel and GitLab each need a stable public HTTPS hostname that users and browsers can reach. The Zitadel issuer URL and the GitLab external URL are written into redirect URIs, so changing either hostname later means updating the Zitadel application and the GitLab configuration. Agree on the final names before you create the application.

A GitLab version and upgrade stop plan

Choose the GitLab version you will run and check the upgrade path to it before installation or upgrade. GitLab requires upgrades to pass through required upgrade stops, which since GitLab 17.5 fall at x.2, x.5, x.8 and x.11, for example 19.2, 19.5, 19.8 and 19.11. Record the planned stops in your change calendar so the SSO configuration is re-tested after each one.

GitLab upgrade paths

A trusted TLS certificate chain

The GitLab server must trust the full certificate chain presented by the Zitadel hostname, including any internal or private certificate authority. If the chain is incomplete or the root is missing from the GitLab host trust store, the OpenID Connect discovery and token requests fail with errors that look like login problems. Test the chain from the GitLab server itself, not from your workstation, before you start the configuration.

Configuration sequence for the Zitadel and GitLab connection

This sequence takes a self-managed GitLab instance from no external login to a tested Zitadel sign-in, with each step closed by a check the platform team can verify. It follows the order the Zitadel self-hosted GitLab guide documents, adapted to a GitLab configuration you manage.

  1. Create the Zitadel project and web application

    A Zitadel administrator creates a project in the organization that will own the GitLab login, then adds an application of the web application type. Choose the OIDC protocol and the client authentication method that the Zitadel guide specifies for GitLab, and confirm the choice against the current guide before saving. The step is complete when the application appears in the project with its client credentials available, and the Zitadel instance domain resolves over HTTPS from the GitLab host.

  2. Register the redirect URI GitLab generates

    Find the callback URL GitLab expects for its OpenID Connect provider. It is built from your GitLab external URL and the provider name you will set in the configuration, so settle the name first. Enter that exact URL in the Zitadel application's redirect URI list, character for character, including scheme, host, port and trailing path. The check is a side-by-side comparison of the two values; any mismatch causes the login callback to fail after the user authenticates.

  3. Confirm the Zitadel discovery document

    Before touching GitLab, open the OpenID Connect discovery document for your Zitadel instance from the GitLab server itself, not only from your workstation. The issuer in the response must match the issuer value you will place in GitLab, including the scheme and absence of a trailing slash. A platform engineer runs the request and confirms the JSON returns the authorization and token endpoints. If the request fails or returns a different issuer, resolve DNS, TLS trust or the instance domain before continuing.

  4. Copy the client ID and client secret

    From the Zitadel application, copy the client ID and, if the chosen authentication method uses a secret, the client secret. Store the secret in your secrets manager or in the GitLab configuration file with restricted file permissions, not in a ticket or chat thread. The step is complete when the values are recorded in the location your team uses for GitLab secrets and the secret is rotated or revoked in Zitadel if it was shared outside that store.

  5. Add the OmniAuth OpenID Connect provider block

    Edit the GitLab configuration file on the instance and add an OpenID Connect provider block under the OmniAuth settings. Set the issuer to your Zitadel instance, the client ID and secret from the previous step, the redirect URI that matches the Zitadel registration, and the client authentication method that matches the application. Keep the block syntax exactly as the GitLab authentication documentation shows for your version. The check is a configuration syntax validation run on the GitLab host before any reconfigure.

  6. Reconfigure and restart GitLab

    Apply the change by running the reconfigure command for your installation method, then restart the GitLab services so the new provider loads. Watch the command output for errors about the provider block, and confirm the sign-in page now shows a button for the Zitadel provider. Installation methods differ, so confirm the exact command for your deployment in the GitLab installation documentation before running it in production. The step is complete when the sign-in page lists the provider and the GitLab services report healthy.

  7. Test sign-in and verify the GitLab user

    Sign in from a test account through the Zitadel button in a private browser session. Confirm Zitadel shows its login page, returns you to GitLab without a redirect error, and that GitLab creates or links a user with the expected username and email. Then check the user's identity in the GitLab admin area. Keep an administrator's local password login available until this test passes, so a misconfiguration does not lock every administrator out.

Choosing the client authentication method and GitLab configuration path

Teams that installed GitLab with the Linux package usually manage authentication through the gitlab.rb configuration file and reconfigure the instance after each change. This path keeps the OmniAuth provider settings in one file on the GitLab host, which makes it the most direct route for a single-node or small self-managed instance. The exact key names for the OpenID Connect provider, including the OmniAuth provider block, the client options and the group sync settings, must come from the GitLab authentication documentation for your installed version, not from memory or from an older blog post.

  • Configuration file: Edit gitlab.rb on the GitLab host, then run the reconfigure command so the change takes effect.
  • Secrets handling: Keep the Zitadel client secret out of shared configuration files and restrict read access to the file.
  • Version check: Confirm the OmniAuth key names against the documentation for the GitLab release you run, because options change between releases.
  • Backups: Record the working configuration before a major upgrade so you can compare it with the new defaults.
  • Test path: Verify sign-in with a test user before enabling any group-based access.

Before you move on, confirm that the settings in gitlab.rb match the redirect URI registered in the Zitadel application, character for character.

How user identity and group sync map from Zitadel to GitLab

The identity decision that matters most is which Zitadel claim GitLab uses to match a returning user and which it uses to create a new account. In GitLab's OmniAuth OpenID Connect settings, the subject claim (sub) should be treated as the stable identifier, because it does not change when a person's email address or display name changes. Email is convenient for matching existing local GitLab accounts, but it is only safe if the Zitadel organization verifies email addresses and no two identities can claim the same address. Before go-live, confirm in the GitLab authentication documentation how the OIDC provider links to existing accounts, whether auto-linking by email is enabled, and what happens when a Zitadel user changes email. Then check the claims Zitadel actually returns for the application by inspecting a test token, since the claim names and whether email and email_verified appear depend on the scopes requested and on the Zitadel application and project configuration.

Username and name handling need the same discipline. GitLab derives a username for a new account from the claims it receives, and collisions with existing GitLab usernames can block or distort logins if the mapping is not tested. Decide in advance whether usernames will come from a preferred username claim or from the email local part, who resolves collisions, and whether display names should be overwritten at each login or only set at creation. Test with at least one user who already has a local GitLab account with a matching email, one user with a duplicate name, and one user whose name changes in Zitadel. The exact attribute names and the behavior of each setting should be confirmed against the current GitLab authentication documentation for your release, not assumed from an earlier version.

Group sync is the part most likely to surprise administrators. GitLab can read group membership from a claim supplied by the identity provider, and its group sync options control whether those groups are used to assign access to GitLab groups. This only works if Zitadel is configured to emit a group or role claim for the application, which is a Zitadel project and role design choice made outside the GitLab settings. Confirm which GitLab group sync options exist in your version, whether they add members, remove members, or both, and what happens to users who lose a group in Zitadel. Role mapping, meaning which Zitadel roles become GitLab Owner, Maintainer or Developer, should be decided in the design phase and written down with its approvers, not left to the first person who configures the connection.

Claims and attributes mapped between Zitadel and GitLab

This table compares each Zitadel claim we expect GitLab to read against the GitLab user field or sync behavior it feeds. Rows marked for confirmation depend on the GitLab version and OmniAuth settings in your installation, so check them in a test instance before you enable sign-in for all users.

Zitadel claimGitLab field or behaviorWhat to confirm in your GitLab version
sub (subject)External identity UID used to link the Zitadel account to the GitLab userConfirm the uid setting in the OmniAuth provider uses sub, and that changing it later does not orphan existing accounts
emailGitLab account email, used for matching and notificationsConfirm whether GitLab links an existing local account by email and whether email verification is required before linking
preferred_usernameGitLab username, where the provider mapping uses itConfirm the username mapping and how GitLab handles collisions with existing usernames
nameGitLab display name on the user profileConfirm whether the name is updated on each sign-in or only at account creation
groups or roles (if configured in Zitadel)Input for GitLab group sync, if the chosen sync option reads these claimsConfirm the claim name, the exact claim format, and which group sync option your edition supports; not all group features are in every tier
Account state at sign-inWhether GitLab creates or blocks a user at first loginConfirm the auto-create and block-on-create settings and whether a user removed in Zitadel is still able to sign in to GitLab until its session ends

How a GitLab sign-in request reaches Zitadel and returns

The flow starts when a user selects Zitadel on the GitLab sign-in page. GitLab sends the browser to Zitadel with an authorization code request, and Zitadel authenticates the user and redirects back to the GitLab callback URI with a code. GitLab then exchanges that code server to server for tokens and reads the user's claims. The trust boundary between the two self-hosted systems is where the redirect URI, client ID and client secret must match exactly on both sides. Check that boundary first when a sign-in fails.

Authorization code flow between the user, GitLab and Zitadel, with the callback into GitLab.

Security settings to review for this integration

GitLab signs users in through Zitadel, so the trust between the two systems depends on a handful of settings: how traffic is encrypted, which redirect URIs Zitadel accepts, where the client secret lives, who may use the application, and how much local sign-in GitLab still allows. Review each one before users are moved to Zitadel and again after any change to hostnames or administrators.

TLS on both hostnames

Serve Zitadel and the GitLab instance over HTTPS with valid certificates, because the OpenID Connect flow sends authorization codes and tokens through the browser and back to GitLab. Check that the issuer URL GitLab uses matches the public Zitadel hostname exactly, including scheme and port, and that certificates are issued by a chain GitLab's server trusts. A mismatch here usually shows up as a failed discovery or token exchange, not as a clear error.

Zitadel GitLab guide

Exact redirect URI matching

Register only the callback URL GitLab actually uses, copied from the GitLab OmniAuth configuration, in the Zitadel web application. Avoid wildcards, extra paths and a second entry for a test hostname left over from setup. A loose redirect list lets a crafted link send an authorization response to an address you did not intend, so confirm the registered list after every change to the GitLab external URL.

Client secret storage

Keep the client secret out of plain gitlab.rb edits that get copied into tickets, backups or shared repositories. Store it in a secrets manager or a root-readable file that configuration management fills in at deploy time, and restrict who can read the GitLab configuration directory. Rotate the secret in Zitadel and in GitLab together, and record who holds the rotation procedure.

Restricting application access

Decide which Zitadel organizations, projects and roles may sign in to the GitLab application, and turn on the setting that limits access to users with an explicit grant. Without that restriction, any user in the scoped organization can start a GitLab login, and GitLab will create or link an account for them. Test with one user who should be denied and confirm the denial is logged on both sides.

GitLab administrators and password fallback

Limit GitLab administrator accounts to named people who need them, and decide whether local password sign-in stays enabled as a break-glass path. Every retained local administrator is an identity outside Zitadel's policies, including its MFA and passkey requirements. Document who can use the fallback, how its use is reviewed, and when it is removed after the SSO setup is stable.

GitLab hardening recommendations

Work through GitLab's hardening recommendations after the SSO change, since sign-in is one part of the instance's exposure. Review session timeouts, the sign-up and visibility settings, and how external users are handled alongside the Zitadel login. Record the result as evidence of what was reviewed and when, and treat it as a configuration check rather than an external assessment.

GitLab hardening guide

Common sign-in failures and how to fix them

This table pairs each common Zitadel-to-GitLab sign-in failure with its likely cause, the check to run and the fix. Work through the rows in order, since a discovery or certificate problem will block every later check. Confirm the exact client settings against the Zitadel self-hosted GitLab guide for your versions before changing anything in production.

FailureLikely causeCheck and fix
Redirect URI mismatchThe redirect URI registered on the Zitadel web application does not exactly match the callback URL GitLab sends, often because the GitLab external URL uses a different scheme, host or port.Compare the callback URL in GitLab's logs or error page with the redirect URIs on the Zitadel application. Correct the GitLab external_url or the Zitadel entry so they match character for character, then retry.
Wrong client authentication methodThe GitLab OmniAuth provider sends client credentials in a form the Zitadel web application does not accept, such as basic versus post authentication.Confirm the client authentication method set on the Zitadel application matches the client_auth_method value in the GitLab OpenID Connect provider settings. Align both sides, then test with a fresh login.
Discovery URL unreachable or certificate not trustedGitLab cannot fetch the Zitadel OpenID configuration document, either because the network path is blocked or because the internal certificate authority is not installed on the GitLab host.From the GitLab server, request the discovery URL and check DNS, routing, firewall rules and the TLS chain. If the certificate is private, add the issuing CA to the host trust store and reconfigure GitLab so it picks up the change.
Users unexpectedly created or not linkedThe GitLab account matching behavior does not fit the identifiers Zitadel returns, so a new account is created instead of linking to an existing user, or the login is rejected for an unmatched email.Check which claim GitLab uses to match accounts and confirm the same value exists for existing users in Zitadel. Decide before go-live whether new accounts should be created automatically, and clean up duplicate accounts with an administrator before enabling SSO for everyone.
Group sync not applyingGroup claims are missing from the Zitadel token, the claim name in GitLab does not match, or the group names in Zitadel do not map to existing GitLab groups.Inspect a test user's ID token or userinfo response for the groups claim and confirm the claim name and values. Update the GitLab group sync settings to match, then have the user sign out and sign in again so new claims are read.

Questions teams ask before connecting GitLab to Zitadel

What drives the cost of connecting self-managed GitLab to Zitadel?

The cost follows the written scope, and the main drivers are the number of GitLab instances, the group model, the high availability topology and the depth of testing. A single instance with one identity provider configuration and a flat group model is the smallest case. Each additional instance needs its own Zitadel web application, redirect URIs and OmniAuth settings. Group sync design, whether groups map to Zitadel roles or projects, adds analysis and testing. An HA GitLab deployment adds more places where the callback must resolve correctly. GitLab documents a high availability strategy for 3,000 or more users, so larger installations need more test coverage. DeployOpen does not publish prices. Ask for a quote that lists each instance, the group sync scope, the test cases and whether retesting after upgrades is included.

How long does a GitLab and Zitadel SSO setup take?

The duration is confirmed in the written quote, not assumed before the environment is reviewed. The timeline depends on how many GitLab instances are involved, whether the Zitadel instance already exists in a production-ready state, how group sync is designed, and how many test rounds the change window allows. Access approvals on both the Zitadel and GitLab sides also affect the calendar. Ask the provider to break the timeline into discovery, a staging build, a test group sign-in, a cutover and a post-cutover check, and to state which steps depend on your change approvals.

Can our in-house team set up GitLab SSO with Zitadel using the guide?

Yes, a team with administrator access to both systems can follow the Zitadel documentation for self-hosted GitLab, which covers creating a web application in a Zitadel project and configuring the connection in GitLab. The guide is the starting point, not the whole job. Teams usually need to decide the client authentication method, confirm redirect URIs match the public GitLab hostname exactly, set the OmniAuth provider options, and design group sync before anyone is onboarded. Teams without Zitadel or GitLab administration experience often find the first sign-in test takes longer than the configuration. Start with a staging instance, keep a local administrator account working, and record each setting so the change can be reversed.

What do we need to provide before SSO work starts?

Before work starts, you need administrator access to the Zitadel instance and to the GitLab instance, including the ability to change the GitLab configuration and restart it. Provide the public hostnames for both systems, since redirect URIs must match them exactly. Certificates must be trusted by GitLab and by the sign-in path, and a private certificate authority needs to be available to both. Provide a test group of users in Zitadel, with at least one account that is not an administrator, so sign-in can be tested without changing production access. Also confirm the network path from GitLab to the Zitadel discovery endpoint, and who approves changes in each environment.

Do GitLab Free and Premium tiers change the SSO setup?

The core OpenID Connect connection between Zitadel and GitLab does not depend on the tier you choose, since the GitLab pricing page lists all three tiers as available for self-managed installations. The tier affects what you can build around the login, not the login itself. GitLab lists advanced CI/CD and priority support for Premium, and application security testing, software supply chain security, vulnerability management and compliance features for Ultimate. Confirm with GitLab which group sync and authentication features your chosen tier includes before you finalize the group model. GitLab Free costs 0 dollars, Premium costs 29 US dollars per user per month billed annually according to the GitLab pricing page, and Ultimate is custom priced.

How do GitLab upgrades affect the Zitadel SSO configuration?

Upgrades can change the GitLab side of the configuration, so plan for a retest after each upgrade rather than treating SSO as done. GitLab ships a major release yearly, a minor release on the third Thursday of each month and patch releases twice a month, and it requires upgrades to pass through required upgrade stops. Since GitLab 17.5, those stops fall at versions x.2, x.5, x.8 and x.11, for example 19.5, 19.8 and 19.11. Check the GitLab upgrade paths documentation before each planned upgrade, and confirm that the OmniAuth settings and redirect URIs still match after the update. Keep the Zitadel application and the GitLab configuration under change control so the pair can be reviewed together.

Where to read the source documentation

Start with the Zitadel guide for self-hosted GitLab, which describes the pairing this page covers: a web application created in a Zitadel project, then the matching connection configured in GitLab. Treat that guide as the authority for the Zitadel side of the setup, including the application type, the client authentication method and the redirect URI that Zitadel expects. Before you copy any value from it, compare the guide's screens and field names against the Zitadel release you are running, since the Console layout and default settings can change between major releases. Record the Zitadel version next to your configuration so an upgrade later has a clear baseline to test against.

Then read the GitLab authentication and authorization documentation, which governs the GitLab side: the OmniAuth provider block in gitlab.rb, how the OpenID Connect provider settings are named, and how group sync and user sign-in behave for your edition. Check these sections against the exact GitLab version in use, because GitLab ships a major release yearly, a minor release each month and patch releases twice a month, and configuration keys are the part most likely to be renamed or deprecated. The GitLab maintenance policy and upgrade paths documentation also matter here, since an identity change may need to be planned alongside a required upgrade stop. Confirm with your GitLab administrators which release line you are on and whether any settings are set through the Rails console or environment variables rather than the configuration file.

How DeployOpen scopes and delivers this integration

DeployOpen plans and builds the Zitadel and GitLab connection inside your own infrastructure, from the Zitadel web application and redirect URIs through the GitLab OmniAuth settings and group sync choices. Each step is agreed in writing before work starts, and the result is tested and documented so your team can run it.

How we scope

  • Confirm your GitLab edition, installation method and hostname, plus the Zitadel instance, organization and project that will hold the application.
  • Agree in writing which login methods, client authentication setting, redirect URIs and group sync behavior are in and out of scope.
  • Record who approves identity decisions, which user groups map to GitLab roles, and what acceptance tests must pass before cutover.

How we build

  • Create and configure the Zitadel web application and the matching GitLab OmniAuth provider settings in a staging environment first.
  • Verify the OpenID Connect flow end to end, including first-time account creation, account linking for existing users and sign-out behavior.
  • Apply the production configuration through a controlled change, with rollback steps for GitLab and Zitadel recorded before the change.

How we hand over

  • Deliver the configuration, a test record and a runbook covering secret rotation, redirect URI changes and troubleshooting steps for failed logins.
  • Walk your administrators through the group sync options configured, including what happens when a user leaves a group in Zitadel.
  • Document where secrets are stored and who holds access, so your security and compliance teams can review the setup independently.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, covering GitLab upgrades that may change OmniAuth behavior.
  • Retesting of the login path can follow each Zitadel or GitLab upgrade, scoped in the retainer and agreed before work begins.
  • Changes outside the written scope, such as additional providers or new group mappings, are quoted separately from the original engagement.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.