doc/integration/salesforce.md
{{< details >}}
{{< /details >}}
You can integrate your GitLab instance with Salesforce to enable users to sign in to your GitLab instance with their Salesforce account.
To enable Salesforce OmniAuth provider, you must use the Salesforce credentials for your GitLab instance. To get the credentials (a pair of Client ID and Client Secret), you must create a Connected App on Salesforce.
Sign in to Salesforce.
In Setup, enter App Manager in the Quick Find box, select App Manager, then select New Connected App.
Fill in the application details into the following fields:
<Organization>'s GitLab, <Your Name>'s GitLab, or something else that is descriptive.Select API (Enable OAuth Settings) and select Enable OAuth Settings.
Fill in the application details into the following fields:
https://gitlab.example.com/users/auth/salesforce/callback.Access your basic information (id, profile, email, address, phone) and Allow access to your unique identifier (openid) to the right column.Select Save.
On your GitLab server, open the configuration file.
For Linux package installations:
sudo editor /etc/gitlab/gitlab.rb
For self-compiled installations:
cd /home/git/gitlab
sudo -u git -H editor config/gitlab.yml
Configure the common settings
to add salesforce as a single sign-on provider. This enables Just-In-Time
account provisioning for users who do not have an existing GitLab account.
Add the provider configuration. For Linux package installations:
gitlab_rails['omniauth_providers'] = [
{
name: "salesforce",
# label: "Provider name", # optional label for login button, defaults to "Salesforce"
app_id: "SALESFORCE_CLIENT_ID",
app_secret: "SALESFORCE_CLIENT_SECRET"
}
]
For self-compiled installations:
- { name: 'salesforce',
# label: 'Provider name', # optional label for login button, defaults to "Salesforce"
app_id: 'SALESFORCE_CLIENT_ID',
app_secret: 'SALESFORCE_CLIENT_SECRET'
}
Change SALESFORCE_CLIENT_ID to the Consumer Key from the Salesforce connected application page.
Change SALESFORCE_CLIENT_SECRET to the Consumer Secret from the Salesforce connected application page.
Save the configuration file.
For the changes to take effect:
On the sign in page, there should now be a Salesforce icon below the regular sign in form. Select the icon to begin the authentication process. Salesforce asks the user to sign in and authorize the GitLab application. If everything goes well, the user is returned to GitLab and is signed in.
[!note] GitLab requires the email address of each new user. After the user is signed in using Salesforce, GitLab redirects the user to the profile page where they must provide the email and verify the email.