website/integrations/platforms/salesforce/index.md
Salesforce is a cloud-based CRM platform that provides sales, service, marketing, and analytics applications.
The following placeholders are used in this guide:
company.my.salesforce.com is the FQDN of your Salesforce organization.authentik.company is the FQDN of the authentik installation.:::info This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application. :::
To support the integration of Salesforce with authentik, you must create property mappings for Just-in-Time (JIT) user provisioning and an application/provider pair.
Salesforce JIT provisioning requires specific SAML attributes to automatically create users on first login.
Username Mapping:
User.Usernamereturn request.user.email
Email Mapping:
User.Emailreturn request.user.email
Last Name Mapping:
User.LastNamereturn request.user.name.split()[-1] if request.user.name else "User"
Profile ID Mapping:
Name: Choose a descriptive name
SAML Attribute Name: User.ProfileId
Expression:
return "00eXXXXXXXXXXXXX" # Replace with your Salesforce Profile ID
:::info Find your Salesforce Profile ID
To find your Salesforce Profile ID, in Salesforce, navigate to Setup > Users > Profiles, click on the desired profile, and copy the 18-character ID from the URL (starts with 00e).
:::
Federation Identifier Mapping:
User.FederationIdentifierreturn request.user.email
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Applications > Applications and click Create with Provider to create an application and provider pair.
https://company.my.salesforce.com?so=XXXXXXXXX, replacing XXXXXXXXX with your Salesforce Organization ID.https://authentik.company).Post.authentik default SAML Mapping: Email.Click Submit to save the new application and provider.
authentikhttps://authentik.company).RSA-SHA256HTTP POSThttps://authentik.company/application/saml/<slug>/sso/binding/post/You can configure Salesforce as an OAuth source to allow users to log in to authentik using their Salesforce credentials. Optionally, this can be used alongside SCIM provisioning to keep your Salesforce users in sync with your authentik users.
authentikauthentikhttps://authentik.company/source/oauth/callback/<slug>/, replacing <slug> with the slug you will use when creating the OAuth Source in authentik (e.g., salesforce).Access unique user identifiers (openid)Manage user data via APIs (api)If you plan to use SCIM provisioning with OAuth authentication:
Salesforcesalesforce (this must match the callback URL configured in Salesforce)https://company.my.salesforce.com/services/oauth2/authorizehttps://company.my.salesforce.com/services/oauth2/tokenhttps://company.my.salesforce.com/services/oauth2/userinfo*openid api (the * prefix overrides default scopes)You can configure SCIM provisioning to automatically sync users from authentik to Salesforce. This guide only covers OAuth2 SCIM integration, which requires an enterprise authentik account.
Salesforce requires specific SCIM attributes that are not included in the default mappings.
Profile ID Mapping:
Name: Salesforce SCIM: Profile ID
Expression:
return {
"entitlements": [
{
"value": "00eXXXXXXXXXXXXX" # Replace with your Salesforce Profile ID
}
]
}
:::info Find your Salesforce Profile ID
To find your Salesforce Profile ID, in Salesforce, navigate to Setup > Users > Profiles, click on the desired profile, and copy the 18-character ID from the URL (starts with 00e).
:::
Username Mapping:
Salesforce SCIM: Usernamereturn {
"userName": request.user.email
}
https://company.my.salesforce.com/services/scim/v2{"grant_type": "client_credentials"}Salesforce SCIM: Profile ID and Salesforce SCIM: Username) alongside the default user mapping.