7.6 KiB
| type |
|---|
| howto, reference |
SCIM provisioning using SAML SSO for GitLab.com groups (SILVER ONLY)
Introduced in GitLab.com Silver 11.10.
System for Cross-domain Identity Management (SCIM), is an open standard that enables the automation of user provisioning. When SCIM is provisioned for a GitLab group, membership of that group is synchronized between GitLab and the identity provider.
GitLab's SCIM API implements part of the RFC7644 protocol.
Currently, the following actions are available:
- CREATE
- UPDATE
- DELETE (deprovisioning)
The following identity providers are supported:
- Azure
Requirements
- Group SSO must be configured.
GitLab configuration
Once Single sign-on has been configured, we can:
- Navigate to the group and click Settings > SAML SSO.
- Click on the Generate a SCIM token button.
- Save the token and URL so they can be used in the next step.
Identity Provider configuration
Azure
The SAML application that was created during Single sign-on setup now needs to be set up for SCIM.
-
Check the configuration for your GitLab SAML app and ensure that Name identifier value (NameID) points to
user.objectidor another unique identifier. This will match theextern_uidused on GitLab. -
Set up automatic provisioning and administrative credentials by following the Provisioning users and groups to applications that support SCIM section in Azure's SCIM setup documentation.
During this configuration, note the following:
- The
Tenant URLandsecret tokenare the ones retrieved in the previous step. - Should there be any problems with the availability of GitLab or similar errors, the notification email set will get those.
- It is recommended to set a notification email and check the Send an email notification when a failure occurs checkbox.
- For mappings, we will only leave
Synchronize Azure Active Directory Users to AppNameenabled.
You can then test the connection by clicking on Test Connection. If the connection is successful, be sure to save your configuration before moving on. See below for troubleshooting.
Configure attribute mapping
-
Click on
Synchronize Azure Active Directory Users to AppName, to configure the attribute mapping. -
Click Delete next to the
mailmapping. -
Map
userPrincipalNametoemails[type eq "work"].valueand change its Matching precedence to2. -
Map
mailNicknametouserName. -
Determine how GitLab will uniquely identify users.
- Use
objectIdunless users already have SAML linked for your group. - If you already have users with SAML linked then use the
Name IDvalue from the SAML configuration. Using a different value will likely cause duplicate users and prevent users from accessing the GitLab group.
- Use
-
Create a new mapping:
- Click Add New Mapping.
- Set:
- Source attribute to the unique identifier determined above.
- Target attribute to
id. - Match objects using this attribute to
Yes. - Matching precedence to
1.
-
Create another new mapping:
- Click Add New Mapping.
- Set:
- Source attribute to the unique identifier determined above.
- Target attribute to
externalId.
-
Click the
userPrincipalNamemapping and change Match objects using this attribute toNo.Save your changes and you should have the following configuration:
NOTE: Note: If you used a unique identifier other than
objectId, be sure to map it instead to bothidandexternalId. -
Below the mapping list click on Show advanced options > Edit attribute list for AppName.
-
Leave the
idas the primary and only required field.NOTE: Note:
usernameshould neither be primary nor required as we don't support that field on GitLab SCIM yet. -
Save all the screens and, in the Provisioning step, set the
Provisioning StatustoOn.NOTE: Note: You can control what is actually synced by selecting the
Scope. For example,Sync only assigned users and groupswill only sync the users assigned to the application (Users and groups), otherwise, it will sync the whole Active Directory.
Once enabled, the synchronization details and any errors will appear on the bottom of the Provisioning screen, together with a link to the audit logs.
CAUTION: Warning:
Once synchronized, changing the field mapped to id and externalId will likely cause provisioning errors, duplicate users, and prevent existing users from accessing the GitLab group.
User access and linking setup
As long as Group SAML has been configured, prior to turning on sync, existing GitLab.com users can link to their accounts in one of the following ways, before synchronization is active:
-
By updating their primary email address in their GitLab.com user account to match their identity provider's user profile email address.
-
By following these steps:
- Sign in to GitLab.com if needed.
- Click on the GitLab app in the identity provider's dashboard or visit the GitLab single sign on URL.
- Click on the Authorize button.
New users and existing users on subsequent visits can access the group through the identify provider's dashboard or by visiting links directly.
For role information, please see the Group SAML page
Blocking access
To rescind access to the group, we recommend removing the user from the identity provider or users list for the specific app.
Upon the next sync, the user will be deprovisioned, which means that the user will be removed from the group. The user account will not be deleted unless using group managed accounts.
Troubleshooting
This section contains possible solutions for problems you might encounter.
Testing Azure connection: invalid credentials
When testing the connection, you may encounter an error: You appear to have entered invalid credentials. Please confirm you are using the correct information for an administrative account. If Tenant URL and secret token are correct, check whether your group path contains characters that may be considered invalid JSON primitives (such as .). Removing such characters from the group path typically resolves the error.
Azure: (Field) can't be blank sync error
When checking the Audit Logs for the Provisioning, you can sometimes see the
error Namespace can't be blank, Name can't be blank, and User can't be blank.
This is likely caused because not all required fields (such as first name and last name) are present for all users being mapped.
As a workaround, try an alternate mapping:
- Follow the Azure mapping instructions from above.
- Delete the
name.formattedtarget attribute entry. - Change the
displayNamesource attribute to havename.formattedtarget attribute.




