GitHub and GitLab login in Zitadel

How to let developers sign in to Zitadel with GitHub, GitHub Enterprise, GitLab or self-managed GitLab accounts, including OAuth app setup, scopes, account linking and when to restrict a provider to one organization.

On this page

How GitHub and GitLab login in Zitadel works

Developers and platform teams already hold GitHub, GitHub Enterprise, GitLab or self-managed GitLab accounts, and they want to reuse them instead of creating another password. Zitadel federates login to these providers as upstream identity providers over OAuth and OIDC, so the user authenticates at GitHub or GitLab and Zitadel then issues its own tokens to your applications. The work has three parts: creating an OAuth application at each provider, registering that application in Zitadel, and deciding how each external identity links to a Zitadel user. Zitadel supports GitHub, GitLab and generic OIDC providers, but the exact provider types, the redirect URI Zitadel expects for each one, and the scopes it requests must be confirmed in the Zitadel identity provider documentation for the version you deploy, since these details change between releases.

Before you create anything, confirm which instance you are on and whether the provider should be available to everyone or only to one organization. Registering a GitHub or GitLab provider at instance level makes it visible to every organization on that instance, which suits a shared developer community but may be wrong for a customer whose engineers must only use their own company's GitLab. Ask the provider owner which group or tenant the OAuth application should belong to, because a GitLab application owned by a personal account is hard to hand over later. For self-managed GitLab, also confirm that Zitadel can reach your GitLab hostname and that the certificate chain is trusted from the Zitadel network, since a failed discovery call is a common first-day blocker.

What you need before you register a provider

Before you create any OAuth application at GitHub or GitLab, four things need to be settled: a Zitadel deployment you can administer, owner rights on the source host, a public HTTPS address for callbacks, and a decision on where the provider lives. Each card below covers one of these, and the checks that prevent a failed setup later.

Zitadel deployment and admin access

Confirm which Zitadel release and PostgreSQL version you run, and check both against the database versions listed in the Zitadel documentation. Supported PostgreSQL versions are 14 through 18, and the Zitadel release you run should be checked against the current releases page before you plan the change. You need instance administrator rights to add a social identity provider, so confirm who holds that role and whether a separate operator account exists.

Supported PostgreSQL versions
14 to 18
Zitadel database docs

GitHub or GitLab owner rights

Creating an OAuth application requires owner or administrator rights on the GitHub organization, GitLab group or GitLab instance that will issue the sign-in. A regular developer account cannot register it. Agree in advance who will own the application, since removing that person later can break logins for every developer in the group. Record the owner account in your access register.

Public HTTPS domain for callbacks

GitHub and GitLab send users back to Zitadel at a fixed redirect URI, so Zitadel must expose a stable public HTTPS domain that the provider can reach. The domain must match the external domain in your Zitadel configuration exactly. Changing it later means editing every registered provider. Confirm DNS, the TLS certificate and any reverse proxy or load balancer path before you touch the provider settings.

Your own host URLs for self-managed systems

GitHub Enterprise Server and self-managed GitLab have no shared endpoints, so you must supply your own host URLs for authorization, token and user information. Confirm that Zitadel can reach those endpoints over the network, including any internal certificate authority, proxy or firewall rule between the Zitadel servers and the source host. Test reachability from the Zitadel pods or hosts, not from your laptop.

Instance or organization scope

Decide before you register whether the provider serves the whole Zitadel instance or only one customer organization. An instance-level provider is available to every organization, which suits a shared engineering identity. An organization-level provider keeps access and linking limited to that organization. Changing scope later means re-checking existing links, so write the decision and the reason down.

How a developer login travels between Zitadel and the provider

The login starts in the developer's browser at the application, which redirects to Zitadel. Zitadel then sends the browser to the GitHub or GitLab authorization endpoint, which sits outside your network. After the developer approves, the provider redirects back to Zitadel's callback, where Zitadel exchanges the code, creates or links the local user, and only then issues tokens to the application. Check the callback URL and the linking step, because those are where misconfigurations usually appear.

Developer login sequence across the browser, application, Zitadel and the external provider.

Configure GitHub or GitLab as an identity provider in Zitadel

This sequence takes a developer login provider from an OAuth application at GitHub or GitLab to a verified sign-in through Zitadel, with the callback, scopes and login policy checked at each stage.

  1. Confirm the target provider and scope

    Decide whether the provider is GitHub, GitHub Enterprise, GitLab.com or a self-managed GitLab instance, and whether it is registered at instance level or on one organization. Record the exact base URL of the provider, because a self-managed GitLab or GitHub Enterprise host must match what Zitadel is configured to call. Done when you have a written note of provider type, host URL, and the Zitadel organization that will own the registration.

  2. Create the OAuth application at the provider

    In the provider's developer settings, create a new OAuth application for Zitadel. Paste the redirect (callback) URL that Zitadel displays for this specific provider type into the callback field, character for character, including the path and the protocol. Done when the application is saved and you can see its client ID, and the callback shown in the provider matches the one in Zitadel with no trailing slash difference.

  3. Record the client ID and client secret

    Copy the client ID and generate a client secret from the same OAuth application. Store the secret in your secrets manager or a restricted password vault, not in a ticket or chat thread, and limit who can read it. Done when the secret is stored with an owner and a rotation note, and the client ID is recorded beside the Zitadel organization it belongs to.

  4. Register the provider in Zitadel

    In the Zitadel console, open the identity provider settings at the chosen scope and add a GitHub, GitHub Enterprise, GitLab or GitLab self-managed provider. Enter the client ID, client secret and, for self-managed hosts, the instance URL. Give the provider a clear display name so users recognize the button. Done when the provider appears in the list at the expected scope and its status is active.

  5. Set the requested scopes and attribute mapping

    Set the scopes Zitadel requests from the provider, keeping them to the minimum needed for sign-in and profile fields such as the verified email. Check that the provider's account email is marked as verified, and decide whether automatic user creation or account linking applies. Done when the scope list is written down and a test login shows the consent screen listing only the permissions you expected.

  6. Enable the provider on the login policy

    Open the login policy at the same scope as the provider and enable the new identity provider as a login option. For a provider limited to one organization, confirm the policy applies there and not to the whole instance. Done when the login page for the target organization shows the provider button and the instance-level login page does not show it if you restricted it.

  7. Test a login with a non-admin account

    Sign in with a standard developer account that has no administrator role, using the provider button on the login page. Confirm the consent screen, the redirect back to Zitadel, and that the sign-in completes. Done when the new user appears in the expected organization in the user list after first login, with the provider shown as the linked identity and no administrator rights granted by default.

Which provider fields map to Zitadel user attributes

This table compares each identity field GitHub and GitLab return with the Zitadel user profile field it fills, and who controls that value after first login. Read the verification column first, because a provider email is only safe to trust for linking or account matching when the provider and Zitadel settings confirm it is verified. Confirm each claim name and scope against the provider documentation and your Zitadel identity provider settings before go-live.

Provider identity fieldZitadel user field and what to checkWho owns the value after first login
Stable subject identifierExternal user link keyed to the provider and its user ID. Confirm which claim or API field your Zitadel provider type uses as the stable identifier, because usernames and emails can change.The provider owns it. Zitadel stores it as the link and it should not be edited by hand.
Username or login handleSuggested Zitadel username. Confirm whether Zitadel uses it as is, or whether a naming conflict forces a different value in your organization.Shared. Users can often change the handle on the provider, so the Zitadel username may drift unless you decide how to treat it.
Primary email addressZitadel email field. Confirm the email scope is granted and that the provider marks the address as verified before you trust it for linking or domain matching.The provider owns the address. Changes on GitHub or GitLab do not update Zitadel unless your provisioning or login flow refreshes them.
Email verification stateVerified flag on the Zitadel email. Confirm how the provider reports verification for each address, including whether private or secondary emails are returned at all.The provider owns the verification state. Re-check it at later logins rather than assuming the first result still holds.
Display nameZitadel first name and last name fields. Confirm how the provider splits or omits names, since many developer accounts set only one free-text name.The user or an administrator can edit it in Zitadel after first login, so it may diverge from the provider.
Avatar URLZitadel profile picture field. Confirm the provider exposes an image URL under the scope you request and that your Zitadel version stores it.The provider owns the image. Treat the stored copy as a cache that may go stale.
Organization or group membershipNot a Zitadel profile field by default. Confirm whether you need it for role assignment through Actions, and which scope the provider requires to return it.The provider owns group membership. Zitadel should only mirror it if you design a refresh rule.

Which provider option fits each group of developers

Use this option when your developers sign in with personal or standard GitHub.com accounts and you do not need to restrict access by enterprise membership. Zitadel connects to GitHub.com as a federated identity provider, so the OAuth application is registered on GitHub.com and its client ID and secret are entered in Zitadel. The callback URL must match the redirect URI that Zitadel shows for the GitHub provider, including the instance or organization domain you chose.

  • Host URLs: Confirm the authorization and token endpoints that Zitadel's GitHub provider uses for github.com, and copy the redirect URI from the Zitadel console rather than typing it by hand.
  • Who creates the app: Any GitHub.com user who owns the registering account or organization can create an OAuth application, so assign that to a named owner.
  • Membership and access: GitHub.com login proves account ownership only. Decide in Zitadel which organization or project grants apply, because GitHub team membership does not restrict sign-in unless you build that check yourself.
  • Scopes: Request the minimum scopes needed to read the user profile and email, and confirm with GitHub's current documentation what each scope returns.
  • Verify before testing: Check that the OAuth app is active, that the callback URL matches exactly, and that a test account with a private email address still returns the claims your flow needs.

Before testing, confirm on the GitHub.com application settings page that the callback URL and client secret are the ones entered in Zitadel.

Account linking and when to restrict a provider to one organization

The main decision in this section is whether a GitHub or GitLab identity should attach to an existing Zitadel user only after a deliberate step, or whether Zitadel should create a new user the first time someone signs in with that provider. For developers, the risk is concrete: an engineer who already has a local Zitadel login with a work email may end up with a second, unlinked account when they first click the GitHub button. That duplicate splits roles, grants and audit history across two identities. A linking prompt, where the user must authenticate to the existing local account before the external identity is attached, is the safer default for workforce users. Automatic creation suits a narrower case, such as a fresh organization with no prior accounts. Confirm the exact linking and auto-creation options for your Zitadel version in the identity provider documentation before you write your login policy, and test both paths with a sample engineer account before rollout.

Restricting GitHub or GitLab login to one organization is usually the right call when the organization must not accept personal accounts. A customer organization, a regulated internal team or a contractor group may need to know that every developer who signs in has a verified relationship with them. Scoping the provider at the organization level means the GitHub or GitHub Enterprise client, its redirect URI and its login behavior apply only to users in that organization, so other tenants are unaffected. An instance-level provider is acceptable when every user on the instance is a member of the same company, the GitHub or GitLab tenant is controlled by that company, and the same account rules apply everywhere. Note that for self-managed GitLab, the trust decision rests on the GitLab instance you connect to, so confirm who administers it and whether self-registration is open.

Security settings for provider-based developer login

Logging developers in through GitHub or GitLab adds an external trust relationship to your identity layer. The controls below cover the OAuth client, the scopes it requests, who can change provider configuration, the privileged accounts that manage it, and the audit trail that shows what changed. Confirm each setting against your own security policy and the current Zitadel security documentation before you rely on it.

Protect the OAuth client secret

The GitHub or GitLab OAuth client secret lets Zitadel exchange authorization codes for tokens on your behalf, so anyone holding it can impersonate the integration. Store it in a dedicated secrets manager, not in Helm values files, Terraform state or console notes, and limit read access to the platform team. Plan a rotation schedule and a rotation runbook that updates the secret in Zitadel and in the provider's OAuth app together, so login does not break mid-rotation. Confirm the storage and rotation approach with your own policy owners.

Identity provider docs

Restrict requested scopes to login

Request only the scopes that login needs, such as the basic profile and email for sign-in. Broader scopes on GitHub or GitLab can grant access to repositories, groups or API data that Zitadel does not need to identify the user. Review the scope list in each provider configuration whenever it changes, and confirm the provider-side OAuth app grants no more than the Zitadel configuration asks for. Document the approved scope list so reviewers can compare it with the live setting.

Limit who can edit providers

Changing an identity provider in the Zitadel console alters which accounts can sign in and where their identities come from. Restrict edit rights for provider configuration to a small administrator group, separate from people who manage applications or user records. Check how instance-level and organization-level administrator roles differ, since an organization administrator may be able to change settings that affect only that organization. Confirm the role model in the current Zitadel documentation before assigning these rights.

Require strong sign-in for privileged roles

Accounts that can change identity providers or reach the Zitadel console should not depend on a password alone. Zitadel supports passkeys based on FIDO2 and WebAuthn with fallback to password login, so decide whether privileged administrators must register a passkey or a second factor and whether the fallback is allowed for them. Enforce the policy through login settings for the administrator accounts, then test that a privileged account cannot sign in with a weaker method. Confirm the enforcement options for your Zitadel version.

Passkey docs

Review organizations that accept external providers

A GitHub or GitLab provider added at instance level is available to every organization in that instance, which can widen who can sign in. Decide per organization whether external developer providers are allowed, and keep the list of approved organizations in writing. Review the list on a set schedule and after any new tenant onboarding. Where a customer or business unit must not accept a public provider, scope the provider to a single organization or leave it off that organization's login options.

Organizations docs

Log and review provider changes

Every creation, edit, deletion or secret rotation of a provider should leave a record that someone reviews. Confirm that Zitadel audit events for provider changes reach your central log store, that the events show the acting administrator and the time, and that alerts fire on changes made outside the change process. Test the trail with a deliberate, approved change in a staging instance, then check that the record is complete. Confirm retention and review frequency with your compliance team.

Common failures when GitHub or GitLab login breaks

This table lists the failures most often seen when GitHub, GitHub Enterprise or GitLab sign-in stops working through Zitadel, with the likely cause, the check to run and the fix for each. Work through the rows in order, since a redirect mismatch or untrusted certificate blocks everything after it.

FailureLikely cause and checkFix
Callback or redirect URI mismatchThe OAuth app at GitHub or GitLab lists a callback URL that differs from the redirect URI Zitadel shows for the identity provider, often in scheme, host, port or path. Compare both strings character by character.Copy the redirect URI from the Zitadel provider settings into the OAuth app, save, and retry with a fresh browser session.
Client secret rotated at the provider onlyThe provider generated a new client secret, but the Zitadel identity provider still holds the old value, so the token exchange is rejected. Check the provider's audit or app settings for a recent rotation date.Enter the new client ID and secret in Zitadel, save, and confirm a test login from a clean session.
Self-managed GitLab certificate not trustedZitadel's server cannot validate the TLS certificate or certificate chain presented by the GitLab host, often because the certificate is issued by an internal certificate authority. Test from the Zitadel host with a command-line HTTPS request.Install the internal root or intermediate certificate in the trust store used by the Zitadel container or host, then restart the service.
Host name mismatch on self-managed GitLabThe issuer or endpoint URL configured in Zitadel does not match the external host name GitLab advertises, so discovery or token calls go to the wrong address. Compare the configured URL with the GitLab external URL setting.Correct the base URL in the Zitadel provider to the exact external address and make sure DNS resolves it from the Zitadel network.
Email empty after loginThe OAuth scopes requested do not include the one that returns a verified email, such as the user email scope for GitHub, so the profile arrives without an address. Inspect the claims received during a test login.Add the required scopes to the provider configuration, and for GitHub confirm the user's primary email is public or verified where the provider requires it.
Linking collision with an existing userA user with the same verified email already exists locally or under another provider, so automatic creation conflicts or links to the wrong account. Check the user's linked identities in the organization before changing settings.Use an explicit linking step for the existing user, or adjust the automatic creation behavior, and document the decision so duplicate accounts are not created later.
Provider enabled at instance but not visible in the organizationThe provider was created at instance level but the organization's login policy or provider list does not include it, or the organization is using its own settings. Check the login options shown for that organization in the console.Enable the provider in the organization's login settings, or create it at organization level, then test with a user from that organization.

Questions teams ask before connecting GitHub or GitLab to Zitadel

Can our team set up GitHub or GitLab login in Zitadel without outside help?

Yes, if you have someone comfortable with OIDC, your Zitadel administration and the admin console of your code host. The work is small per provider: register an OAuth application on the host, copy its client ID and secret into Zitadel, set the redirect URI Zitadel gives you, then test a login with a real account. The harder part is usually policy, not configuration: deciding who may sign in, what happens when a developer already has a local account, and who approves the OAuth app on a shared GitHub organization or GitLab group. A partner adds value when those decisions are not yet made or when several providers and organizations must be configured together. Confirm the exact settings screens against the Zitadel version you run, because menus and defaults change between releases.

What drives the effort and cost of a GitHub or GitLab login project?

The main drivers are the number of providers, the number of Zitadel organizations that will offer them, and how much account linking logic you need. Each provider adds an OAuth application, a redirect URI, a secret to store and rotate, and a test pass. Scope grows when different organizations need different providers, when existing users must be linked to their code host identity, or when roles should follow group membership. Recurring work includes rotating client secrets, updating redirect URIs when your Zitadel domain changes, and reviewing the host's OAuth app settings after upgrades. When requesting a quote, ask for the written list of providers, organizations, linking rules, test cases and handover steps. DeployOpen does not publish a price list, and a quote follows from that written scope.

How long does configuring and testing one provider take?

A single provider on a clean Zitadel instance is mostly a short configuration task, while the testing and policy decisions usually take longer than the setup. Plan time for registering the OAuth application with the code host owner, a first login test, a test with an existing account that should be linked, a test with a user who should be refused, and a check of the scopes the login returns. No duration is given here because it depends on your host's approval process, how many tests your policy requires and whether the environment is shared. Ask any provider for a written test plan with pass criteria, and confirm the timeline against your own change process.

What do our GitHub or GitLab owners need to provide?

They need to create or approve the OAuth application and be able to tell you which account or group owns it. For GitHub, that is usually an organization owner or someone with rights to register OAuth apps. For GitLab, it is someone who can create an application at the right level, such as a group or the instance. They also need to confirm which scopes are allowed for sign-in, since login requires only the identity claims and no broad repository access. Ask them for the application's client ID, a reference to where the secret is stored, and a named contact for rotation. Share the exact redirect URI from Zitadel before they register the app, because a mismatch is one of the most common causes of failed logins.

Does GitHub Enterprise or self-managed GitLab take more effort than public GitHub or GitLab.com?

Usually it takes more effort, mainly because the endpoints, certificates and admin approvals are under your control. With GitHub Enterprise or self-managed GitLab, you must confirm the host's base URL, make sure Zitadel can reach it over TLS with a certificate it trusts, and get the OAuth application created by someone with instance-level rights. Network paths and private certificate authorities are frequent sources of delay. The configuration steps in Zitadel are similar, but the verification list is longer. Ask whether the host is reachable from Zitadel's network, which CA chain it uses and whether your code host admins restrict third-party OAuth apps. Confirm the supported endpoints and settings for your specific host version before you start.

Should we restrict GitHub or GitLab login to one organization?

Restrict a provider to one organization when only that customer, business unit or team should use the code host identity. The alternative, offering it at instance level, lets every organization in the instance see the option and can create cross-tenant linking questions. Organization scoping keeps the OAuth application, the allowed users and the linking rules inside one tenant boundary. The trade-off is more configuration when several organizations need the same provider. Decide the scope before you register the app, because moving a provider later changes which users are linked and may require re-testing. Document the decision so auditors and tenant admins can see who controls each provider.

Does restricting a provider to one organization change licensing?

Restricting a provider by organization is a configuration choice in Zitadel and does not change the software license. Zitadel moved its core, Console and hosted login to AGPL 3.0 with v3.0 on 31 March 2025, while APIs, SDKs, documentation, Helm charts and Terraform configurations stay Apache 2.0. Scoping a provider does not alter those terms. Licensing questions can still matter if you modify the core or offer Zitadel as a service, so confirm your obligations with your legal team against the license text in the Zitadel blog post on the license change. The code host's own terms for OAuth apps and API use are separate and should be checked with its owner.

How DeployOpen scopes and delivers Zitadel provider login

DeployOpen scopes GitHub and GitLab login in Zitadel as a written, fixed-scope engagement covering OAuth app setup, account linking, provider restrictions and handover. The work runs inside your own infrastructure, so your team keeps control of the Zitadel instance, the provider applications and the resulting user records.

How we scope

  • We confirm which providers apply: GitHub.com, GitHub Enterprise, GitLab.com or self-managed GitLab, and which developer groups use each.
  • We agree whether providers are offered at instance level or only on named customer organizations, and document the reason.
  • We record the linking policy, the fallback login method and the owner of each OAuth application in the written scope.

How we build

  • We create and configure the GitHub or GitLab OAuth applications, redirect URIs and scopes, and register each provider in Zitadel.
  • We test first login, account linking to existing local users and denial paths for accounts outside the permitted group.
  • We set provider restrictions so that organization-scoped identity providers are offered only to the intended organization.

How we hand over

  • We deliver configuration documentation covering provider settings, redirect URIs, scopes, client secret rotation ownership and linking behavior.
  • We walk your administrators through the login flow and the steps to add a provider or revoke an organization's access.
  • We provide a test record of logins, linking outcomes and restriction checks so your team can repeat them after changes.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers when provider apps or Zitadel versions change.
  • We can retest provider login after Zitadel upgrades or changes to GitHub or GitLab OAuth settings, as the written scope defines.
  • Support scope, response arrangements and recurring costs are agreed in writing, and we quote them from the defined scope.

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.