triauth for GitLabOIDC
Let your team sign in to your own GitLab with one approval on their device, and no GitLab passwords.
- Sign-in through
- OpenID Connect bridge
- Available in
- GitLab Self-Managed, all tiers
- Set up in
/etc/gitlab/gitlab.rb
About GitLab
GitLab is where software teams keep their code, review each other's changes, track issues, and run automated builds and releases. Teams run it on their own server, or use the hosted version at gitlab.com.
Connect GitLab to triauth
GitLab signs people in through the triauth OpenID Connect bridge. Once connected, GitLab's sign-in page shows an option with your domain's name below the regular form. People on your team choose it, type their username, and approve on their own device. Nobody keeps a GitLab password, and when someone leaves, removing their identity records at your domain ends their access to GitLab as well.
This page is about a GitLab that you run yourself. The hosted gitlab.com signs people in with its own accounts.
How it works
Open oidc.triauth.org and enter your domain.
Paste GitLab's redirect address,
https://gitlab.example.com/users/auth/openid_connect/callbackwith your own GitLab address in place ofgitlab.example.com, and click Connect app. The bridge gives you a client ID and a client secret.On your GitLab server, add the settings below to
/etc/gitlab/gitlab.rband runsudo gitlab-ctl reconfigure. Replaceexample.comwith your domain,gitlab.example.comwith your GitLab address, and the two placeholders with the client ID and the client secret from the bridge.rubygitlab_rails['omniauth_allow_single_sign_on'] = ['openid_connect'] # To let new people in without an administrator approving each account: # gitlab_rails['omniauth_block_auto_created_users'] = false gitlab_rails['omniauth_providers'] = [ { name: "openid_connect", label: "example.com", args: { name: "openid_connect", scope: ["openid", "profile", "email"], response_type: "code", issuer: "https://oidc.triauth.org/example.com", discovery: true, pkce: true, client_options: { identifier: "<client ID from the bridge>", secret: "<client secret from the bridge>", redirect_uri: "https://gitlab.example.com/users/auth/openid_connect/callback" } } } ]Open GitLab's sign-in page and choose the new option with your domain's name.
Checkpoint
GitLab's sign-in page shows a new button with your domain's name below the regular form. Choosing it opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve.
Good to know
- Everyone with an identity at your domain can sign in. New accounts wait for an administrator's approval first, unless you remove the
#from the line in the settings above that mentions it. - People who already have a GitLab account sign in with their old password once to connect it, and use triauth from then on.
- Pushing and pulling code over HTTPS keeps using a personal access token or an SSH key, as with every single sign-on provider.
- Using the groups published at your domain to grant GitLab admin or restricted status is part of GitLab's paid tiers.
For the person who connects the app
| Setting | Value |
|---|---|
| Redirect address | https://<your-gitlab>/users/auth/openid_connect/callback |
| Where in GitLab | /etc/gitlab/gitlab.rb, key gitlab_rails['omniauth_providers'], then sudo gitlab-ctl reconfigure |
| Discovery | discovery: true makes GitLab read the addresses from https://oidc.triauth.org/<your domain>/.well-known/openid-configuration |
| New accounts | omniauth_block_auto_created_users decides whether an administrator approves each new account |
| Groups | groups_attribute, required_groups, admin_groups, and similar keys, in GitLab's paid tiers |
GitLab's OpenID Connect guide explains every key, including the Helm chart and source installations.
Next steps
- Read the OpenID Connect bridge page for what every connected app gets and what the bridge keeps private.
- Read Roll out to your team to give everyone in your organization an identifier at your domain.
- Read Groups to publish teams at your domain.
- Read GitLab's OpenID Connect guide for every setting GitLab offers.
All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.