2019-09-04 21:01:54 +05:30
---
2020-06-23 00:09:42 +05:30
stage: Manage
2022-04-04 11:22:00 +05:30
group: Authentication and Authorization
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2019-09-04 21:01:54 +05:30
---
2022-10-11 01:57:18 +05:30
# Configure SCIM for GitLab.com groups **(PREMIUM SAAS)**
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
You can use the open standard System for Cross-domain Identity Management (SCIM) to automatically:
2019-09-04 21:01:54 +05:30
2022-10-11 01:57:18 +05:30
- Create users.
- Remove users (deactivate SCIM identity).
2020-05-24 23:13:21 +05:30
2022-10-11 01:57:18 +05:30
GitLab SAML SSO SCIM doesn't support updating users.
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
When SCIM is enabled for a GitLab group, membership of that group is synchronized between GitLab and an identity provider.
2019-07-31 22:56:46 +05:30
2022-11-25 23:54:43 +05:30
The [internal GitLab SCIM API ](../../../development/internal_api/index.md#scim-api ) implements part of [the RFC7644 protocol ](https://www.rfc-editor.org/rfc/rfc7644 ).
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
## Configure GitLab
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
Prerequisites:
2019-09-30 21:07:59 +05:30
2022-10-11 01:57:18 +05:30
- [Group single sign-on ](index.md ) must be configured.
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
To configure GitLab SAML SSO SCIM:
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
1. On the top bar, select **Main menu > Groups** and find your group.
2021-12-11 22:18:48 +05:30
1. On the left sidebar, select **Settings > SAML SSO** .
1. Select **Generate a SCIM token** .
2022-10-11 01:57:18 +05:30
1. For configuration of your identity provider, save the:
- Token from the **Your SCIM token** field.
- URL from the **SCIM API endpoint URL** field.
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
## Configure an identity provider
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
You can configure one of the following as an identity provider:
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
- [Azure Active Directory ](#configure-azure-active-directory ).
- [Okta ](#configure-okta ).
- [OneLogin ](#configure-onelogin ).
2020-05-24 23:13:21 +05:30
2022-10-11 01:57:18 +05:30
NOTE:
Other providers can work with GitLab but they have not been tested and are not supported.
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
### Configure Azure Active Directory
2019-07-31 22:56:46 +05:30
2022-11-25 23:54:43 +05:30
Prerequisites:
- [GitLab is configured ](#configure-gitlab ).
2022-10-11 01:57:18 +05:30
The SAML application created during [single sign-on ](index.md ) set up for
2022-11-25 23:54:43 +05:30
[Azure Active Directory ](https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/view-applications-portal )
2022-10-11 01:57:18 +05:30
must be set up for SCIM. For an example, see [example configuration ](example_saml_config.md#scim-mapping ).
2019-10-12 21:52:04 +05:30
2022-10-11 01:57:18 +05:30
To configure Azure Active Directory for SCIM:
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
1. In your app, go to the **Provisioning** tab and select **Get started** .
1. Set the **Provisioning Mode** to **Automatic** .
1. Complete the **Admin Credentials** using the value of:
- **SCIM API endpoint URL** in GitLab for the **Tenant URL** field.
- **Your SCIM token** in GitLab for the **Secret Token** field.
1. Select **Test Connection** . If the test is successful, save your configuration before continuing, or see the
2022-11-25 23:54:43 +05:30
[troubleshooting ](troubleshooting.md ) information.
2022-10-11 01:57:18 +05:30
1. Select **Save** .
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
After saving, **Settings** and **Mappings** sections appear.
1. Under **Settings** , if required, set a notification email and select the
**Send an email notification when a failure occurs** checkbox.
1. Under **Mappings** , we recommend you:
1. Keep **Provision Azure Active Directory Users** enabled and select the **Provision Azure Active Directory Users**
link to [configure attribute mappings ](#configure-attribute-mappings ).
1. Below the mapping list select the **Show advanced options** checkbox.
1. Select the **Edit attribute list for customappsso** link.
1. Ensure the `id` is the primary and required field, and `externalId` is also required.
1. Select **Save** .
1. Return to the **Provisioning** tab, saving unsaved changes if necessary.
1. Select **Edit attribute mappings** .
1. Under **Mappings** :
1. Select **Provision Azure Active Directory Groups** .
1. On the Attribute Mapping page, turn off the **Enabled** toggle. Leaving it turned on doesn't break the SCIM user
provisioning, but it causes errors in Azure Active Directory that may be confusing and misleading.
1. Select **Save** .
1. Return to the **Provisioning** tab, saving unsaved changes if necessary.
1. Select **Edit attribute mappings** .
1. Turn on the **Provisioning Status** toggle. Synchronization details and any errors appears on the bottom of the
**Provisioning** screen, together with a link to the audit events.
2022-04-04 11:22:00 +05:30
2022-10-11 01:57:18 +05:30
WARNING:
Once synchronized, changing the field mapped to `id` and `externalId` may cause a number of errors. These include
provisioning errors, duplicate users, and may prevent existing users from accessing the GitLab group.
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
#### Configure attribute mappings
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
While [configuring Azure Active Directory for SCIM ](#configure-azure-active-directory ), you configure attribute mappings.
For an example, see [example configuration ](example_saml_config.md#scim-mapping ).
2019-09-30 21:07:59 +05:30
2022-10-11 01:57:18 +05:30
The following table provides attribute mappings known to work with GitLab.
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
| Source attribute | Target attribute | Matching precedence |
|:--------------------|:-------------------------------|:--------------------|
| `objectId` | `externalId` | 1 |
| `userPrincipalName` | `emails[type eq "work"].value` | |
| `mailNickname` | `userName` | |
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
Each attribute mapping has:
2019-10-12 21:52:04 +05:30
2022-10-11 01:57:18 +05:30
- An Azure Active Directory attribute (source attribute).
- A `customappsso` attribute (target attribute).
- A matching precedence.
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
For each attribute:
2019-09-30 21:07:59 +05:30
2022-10-11 01:57:18 +05:30
1. Select the attribute to edit it.
1. Select the required settings.
1. Select **Ok** .
2019-07-31 22:56:46 +05:30
2022-10-11 01:57:18 +05:30
If your SAML configuration differs from [the recommended SAML settings ](index.md#azure-setup-notes ), select the mapping
attributes and modify them accordingly. In particular, the `objectId` source attribute must map to the `externalId`
target attribute.
2019-09-04 21:01:54 +05:30
2022-10-11 01:57:18 +05:30
If a mapping is not listed in the table, use the Azure Active Directory defaults. For a list of required attributes,
2022-11-25 23:54:43 +05:30
refer to the [internal SCIM API ](../../../development/internal_api/index.md#scim-api ) documentation.
2019-12-26 22:10:19 +05:30
2022-10-11 01:57:18 +05:30
### Configure Okta
2020-05-24 23:13:21 +05:30
2022-11-25 23:54:43 +05:30
The SAML application created during [single sign-on ](index.md ) set up for Okta must be set up for SCIM.
2021-01-29 00:20:46 +05:30
2022-11-25 23:54:43 +05:30
Prerequisites:
- You must use the Okta [Lifecycle Management ](https://www.okta.com/products/lifecycle-management/ ) product. This
product tier is required to use SCIM on Okta.
- [GitLab is configured ](#configure-gitlab ).
- SAML application for [Okta ](https://developer.okta.com/docs/guides/build-sso-integration/saml2/main/ ) set up as
described in the [Okta setup notes ](index.md#okta-setup-notes ).
- Your Okta SAML setup matches the [configuration steps exactly ](index.md ), especially the NameID configuration.
2022-05-07 20:08:51 +05:30
2022-11-25 23:54:43 +05:30
To configure Okta for SCIM:
2020-05-24 23:13:21 +05:30
1. Sign in to Okta.
2022-07-16 23:28:13 +05:30
1. Ensure you are in the Admin Area by selecting the **Admin** button located in the top right. The button is not visible from the Admin Area.
2022-01-26 12:08:38 +05:30
1. In the **Application** tab, select **Browse App Catalog** .
2022-11-25 23:54:43 +05:30
1. Search for **GitLab** , find and select the **GitLab** application.
2021-12-11 22:18:48 +05:30
1. On the GitLab application overview page, select **Add** .
2022-11-25 23:54:43 +05:30
1. Under **Application Visibility** select both checkboxes. Currently the GitLab application does not support SAML
authentication so the icon should not be shown to users.
2021-12-11 22:18:48 +05:30
1. Select **Done** to finish adding the application.
1. In the **Provisioning** tab, select **Configure API integration** .
2020-05-24 23:13:21 +05:30
1. Select **Enable API integration** .
2022-11-25 23:54:43 +05:30
- For **Base URL** , paste the URL you copied from **SCIM API endpoint URL** on the GitLab SCIM configuration page.
- For **API Token** , paste the SCIM token you copied from **Your SCIM token** on the GitLab SCIM
configuration page.
1. To verify the configuration, select **Test API Credentials** .
1. Select **Save** .
2021-12-11 22:18:48 +05:30
1. After saving the API integration details, new settings tabs appear on the left. Select **To App** .
1. Select **Edit** .
1. Select the **Enable** checkbox for both **Create Users** and **Deactivate Users** .
1. Select **Save** .
2022-11-25 23:54:43 +05:30
1. Assign users in the **Assignments** tab. Assigned users are created and managed in your GitLab group.
2020-05-24 23:13:21 +05:30
2022-11-25 23:54:43 +05:30
### Configure OneLogin
2020-05-24 23:13:21 +05:30
2022-11-25 23:54:43 +05:30
Prerequisites:
2020-05-24 23:13:21 +05:30
2022-11-25 23:54:43 +05:30
- [GitLab is configured ](#configure-gitlab ).
2021-04-17 20:07:23 +05:30
2022-11-25 23:54:43 +05:30
OneLogin provides a **GitLab (SaaS)** app in their catalog, which includes a SCIM integration. Contact OneLogin if you
encounter issues.
2021-04-17 20:07:23 +05:30
2020-03-13 15:44:24 +05:30
## User access and linking setup
2021-04-29 21:17:54 +05:30
During the synchronization process, all of your users get GitLab accounts, welcoming them
to their respective groups, with an invitation email. When implementing SCIM provisioning,
you may want to warn your security-conscious employees about this email.
2020-11-24 15:15:51 +05:30
The following diagram is a general outline on what happens when you add users to your SCIM app:
```mermaid
graph TD
2022-06-21 17:19:12 +05:30
A[Add User to SCIM app] -->|IdP sends user info to GitLab| B(GitLab: Does the email exist?)
2020-11-24 15:15:51 +05:30
B -->|No| C[GitLab creates user with SCIM identity]
B -->|Yes| D[GitLab sends message back 'Email exists']
```
2021-11-11 11:23:49 +05:30
During provisioning:
- Both primary and secondary emails are considered when checking whether a GitLab user account exists.
- Duplicate usernames are also handled, by adding suffix `1` upon user creation. For example,
due to already existing `test_user` username, `test_user1` is used.
2022-01-26 12:08:38 +05:30
If [Group SAML ](index.md ) has been configured and you have an existing GitLab.com account, you can link your SCIM and SAML identities:
2020-03-13 15:44:24 +05:30
2022-01-26 12:08:38 +05:30
1. Update the [primary email ](../../profile/index.md#change-your-primary-email ) address in your GitLab.com user account to match the
user profile email address in your identity provider.
1. [Link your SAML identity ](index.md#linking-saml-to-your-existing-gitlabcom-account ).
2020-03-13 15:44:24 +05:30
2020-11-24 15:15:51 +05:30
We recommend users do this prior to turning on sync, because while synchronization is active, there may be provisioning errors for existing users.
2022-08-13 15:12:31 +05:30
New users and existing users on subsequent visits can access the group through the identity provider's dashboard or by visiting links directly.
2020-03-13 15:44:24 +05:30
2022-05-07 20:08:51 +05:30
[In GitLab 14.0 and later ](https://gitlab.com/gitlab-org/gitlab/-/issues/325712 ), GitLab users created by [SAML SSO ](index.md#user-access-and-management ) or SCIM provisioning display with an **Enterprise** badge in the **Members** view.
2021-09-04 01:27:46 +05:30
![Enterprise badge for users created with a SCIM identity ](img/member_enterprise_badge_v14_0.png )
2022-11-25 23:54:43 +05:30
For role information, see the [Group SAML page ](index.md#user-access-and-management )
2020-03-13 15:44:24 +05:30
### Blocking access
2022-11-25 23:54:43 +05:30
To rescind access to the top-level group, all subgroups, and projects, remove or deactivate the user
2022-03-02 08:16:31 +05:30
on the identity provider. After the identity provider performs a sync, based on its configured schedule, the user's membership is revoked and they lose access.
2020-11-24 15:15:51 +05:30
2021-02-22 17:27:13 +05:30
NOTE:
2021-11-11 11:23:49 +05:30
Deprovisioning does not delete the GitLab user account.
2020-11-24 15:15:51 +05:30
```mermaid
graph TD
A[Remove User from SCIM app] -->|IdP sends request to GitLab| B(GitLab: Is the user part of the group?)
B -->|No| C[Nothing to do]
B -->|Yes| D[GitLab removes user from GitLab group]
```