doc/tutorials/auth/saml_saas.md
This tutorial walks you through setting up SAML single sign-on (SSO) for a GitLab.com group using an Identity Provider (IdP) such as Okta or Microsoft Entra ID. When you finish, members of your group can sign in to GitLab through the IdP.
In this tutorial, you:
Prerequisites:
Time to complete: 20-30 minutes
Before you can set up anything in your IdP, you must get some connection details from GitLab that tell your IdP how to communicate with your GitLab group.
To gather the GitLab information:
Now that you have your GitLab details ready, create an application in your IdP. This application maps the GitLab information to the IdP and configures how user information flows between the two systems.
To create an IdP application:
{{< tabs >}}
{{< tab title="Okta" >}}
GitLab SAML.user.getInternalProperty("id").emailuser.emailThe SAML application is created in Okta.
[!note] For more information about SAML attributes and advanced configuration options, see the SAML SSO documentation.
{{< /tab >}}
{{< tab title="Entra ID" >}}
GitLab SAML.The enterprise application is created in Microsoft Entra ID.
email.user.mail.user.objectid.[!note] For more information about SAML attributes and advanced configuration options, see the SAML SSO documentation.
{{< /tab >}}
{{< /tabs >}}
Now retrieve the information that GitLab needs to send authentication requests to the IdP.
To gather the connection details:
{{< tabs >}}
{{< tab title="Okta" >}}
In your Okta SAML app, select the Sign On tab.
On the right side, select View SAML setup instructions.
Note the Identity Provider Single Sign-On URL.
Generate a certificate fingerprint:
# Replace `<certificate_filename>` with the actual filename of your downloaded certificate.
# You might need to install OpenSSL or use an alternative method to generate the fingerprint.
openssl x509 -noout -fingerprint -sha256 -in <certificate_filename>.crt
Copy the fingerprint value after SHA256 Fingerprint=.
The fingerprint looks like A1:B2:C3:D4:E5:F6:....
{{< /tab >}}
{{< tab title="Entra ID" >}}
A1B2C3D4E5F6....{{< /tab >}}
{{< /tabs >}}
You have everything you need to complete the connection. Return to GitLab and enter the connection details to turn on SAML authentication for your group.
To configure SAML:
The basic SAML connection is now configured.
[!note] You can set the default membership role to any role. All new users are assigned this role when they first sign in through SAML. Setting the default to Minimal Access and promoting users later reduces the risk of users having too much access.
Before you invite your team, verify that the connection works correctly.
To test the SAML configuration:
If you see errors, see the troubleshooting guide.
The configuration looks good. Now test the experience from a user's perspective by linking a test account like your team members do when they first connect to GitLab through the IdP.
To test user account linking:
Congratulations! You have successfully linked a SAML identity to a GitLab account.
You have a working SAML setup. As an optional final step, you can turn on SSO enforcement. SSO enforcement requires all group members to authenticate through the IdP, which strengthens security. However, it prevents access through other authentication methods.
To turn on SSO enforcement:
After you enable enforcement, all group members must sign in through the IdP before they can access group resources.
You've successfully set up SAML SSO for your GitLab group! Here are some things you might want to do next:
If you encounter issues during this tutorial, see the following resources: