Integrate with Salesforce
Support level: Community
What is Salesforce
Salesforce is a cloud-based CRM platform that provides sales, service, marketing, and analytics applications.
Preparation
The following placeholders are used in this guide:
company.my.salesforce.comis the FQDN of your Salesforce organization.authentik.companyis the FQDN of the authentik installation.
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.
authentik configuration
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.
Create property mappings
Salesforce JIT provisioning requires specific SAML attributes to automatically create users on first login.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Customization > Property Mappings and click Create. Create five SAML Provider Property Mappings with the following settings:
-
Username Mapping:
- Name: Choose a descriptive name
- SAML Attribute Name:
User.Username - Expression:
return request.user.email
-
Email Mapping:
- Name: Choose a descriptive name
- SAML Attribute Name:
User.Email - Expression:
return request.user.email
-
Last Name Mapping:
- Name: Choose a descriptive name
- SAML Attribute Name:
User.LastName - Expression:
return 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 IDFind your Salesforce Profile IDTo 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:
- Name: Choose a descriptive name
- SAML Attribute Name:
User.FederationIdentifier - Expression:
return request.user.email
-
Create an application and provider in authentik
-
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.
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Take note of the Slug as it will be required later.
- Choose a Provider type: select SAML Provider as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- Set the ACS URL to
https://company.my.salesforce.com?so=XXXXXXXXX, replacingXXXXXXXXXwith your Salesforce Organization ID. - Set the Issuer to a unique identifier (e.g.,
https://authentik.company). - Set the Service Provider Binding to
Post. - Under Advanced protocol settings:
- Select an available Signing Certificate.
- Set NameID Property Mapping to
authentik default SAML Mapping: Email. - Add all five Property Mappings you created in the previous section.
- Set the ACS URL to
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's My applications page.
-
Click Submit to save the new application and provider.
Download the signing certificate
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Applications > Providers and click on the name of the SAML provider you created.
- Under Related objects > Download signing certificate, click Download. This certificate file will be required for the Salesforce configuration.
Salesforce configuration
Enable SAML Single Sign-On
- Log in to your Salesforce organization as an administrator.
- Navigate to Setup > Identity > Single Sign-On Settings.
- Click Edit and enable SAML Enabled.
- Click Save.
Create a new SAML Single Sign-On configuration
- On the Single Sign-On Settings page, under SAML Single Sign-On Settings, click New.
- Enter the following values:
- Name:
authentik - Issuer: Enter the same issuer value you configured in authentik (e.g.,
https://authentik.company). - Identity Provider Certificate: Upload the signing certificate that you downloaded from authentik.
- Request Signing Certificate: Select the default certificate or leave as-is.
- Request Signature Method:
RSA-SHA256 - SAML Identity Type: Select Assertion contains the Federation ID from the User object.
- SAML Identity Location: Select Identity is in the NameIdentifier element of the Subject statement.
- Service Provider Initiated Request Binding:
HTTP POST - Identity Provider Login URL: Enter the SSO URL (Post) from your authentik provider.
https://authentik.company/application/saml/<slug>/sso/binding/post/
- Name:
- Click Save.
Enable Just-in-Time provisioning
- On the SAML Single Sign-On configuration page that you just created, click Edit.
- Under Just-in-Time User Provisioning, check User Provisioning Enabled.
- Select Standard for the provisioning type.
- Click Save.