doc/administration/dedicated/configure_instance/authentication/openid_connect.md
{{< details >}}
{{< /details >}}
Configure OpenID Connect (OIDC) single sign-on (SSO) for your GitLab Dedicated instance to authenticate users with your identity provider.
Use OIDC SSO when you want to:
[!note] This configures OIDC for end users of your GitLab Dedicated instance. To configure SSO for Switchboard administrators, see configure Switchboard SSO.
Prerequisites:
To configure OIDC for your GitLab Dedicated instance:
In your support ticket, provide the following configuration:
{
"label": "Login with OIDC",
"issuer": "https://accounts.example.com",
"discovery": true
}
Provide your Client ID and Client Secret securely using a temporary link to a secrets manager that the support team can access.
If your identity provider does not support auto discovery, include the client endpoint options. For example:
{
"label": "Login with OIDC",
"issuer": "https://example.com/accounts",
"discovery": false,
"client_options": {
"end_session_endpoint": "https://example.com/logout",
"authorization_endpoint": "https://example.com/authorize",
"token_endpoint": "https://example.com/token",
"userinfo_endpoint": "https://example.com/userinfo",
"jwks_uri": "https://example.com/jwks"
}
}
After GitLab configures OIDC for your instance:
You can configure GitLab to assign user roles and access based on OIDC group membership.
Prerequisites:
ID token or userinfo endpoint.To configure users based on OIDC group membership:
Add the groups_attribute parameter to specify where GitLab should look for group information.
Configure the appropriate group arrays as needed.
In your support ticket, include the group configuration in your OIDC block. For example:
{
"label": "Login with OIDC",
"issuer": "https://accounts.example.com",
"discovery": true,
"groups_attribute": "groups",
"required_groups": [
"gitlab-users"
],
"external_groups": [
"external-contractors"
],
"auditor_groups": [
"auditors"
],
"admin_groups": [
"gitlab-admins"
]
}
The following parameters are available to configure OIDC for GitLab Dedicated instances. For more information, see use OpenID Connect as an authentication provider.
| Parameter | Description |
|---|---|
issuer | The OpenID Connect issuer URL of your identity provider. |
label | Display name for the login button. |
discovery | Whether to use OpenID Connect discovery (recommended: true). |
| Parameter | Description | Default |
|---|---|---|
admin_groups | Groups with administrator access. | [] |
auditor_groups | Groups with auditor access. | [] |
client_auth_method | Client authentication method. | "basic" |
external_groups | Groups marked as external users. | [] |
groups_attribute | Where to look for groups in the OIDC response. | None |
pkce | Enable PKCE (Proof Key for Code Exchange). | false |
required_groups | Groups required for access. | [] |
response_mode | How the authorization response is delivered. | None |
response_type | OAuth 2.0 response type. | "code" |
scope | OpenID Connect scopes to request. | ["openid"] |
send_scope_to_token_endpoint | Include scope parameter in token endpoint requests. | true |
uid_field | Field to use as the unique identifier. | "sub" |
{
"label": "Google",
"scope": ["openid", "profile", "email"],
"response_type": "code",
"issuer": "https://accounts.google.com",
"client_auth_method": "query",
"discovery": true,
"uid_field": "preferred_username",
"pkce": true
}
{
"label": "Azure AD",
"scope": ["openid", "profile", "email"],
"response_type": "code",
"issuer": "https://login.microsoftonline.com/your-tenant-id/v2.0",
"client_auth_method": "query",
"discovery": true,
"uid_field": "preferred_username",
"pkce": true
}
{
"label": "Okta",
"scope": ["openid", "profile", "email", "groups"],
"response_type": "code",
"issuer": "https://your-domain.okta.com/oauth2/default",
"client_auth_method": "query",
"discovery": true,
"uid_field": "preferred_username",
"pkce": true
}
If you encounter issues with your OpenID Connect configuration: