Connect to Salesforce through Access (SAML)
This guide covers how to configure Salesforce as a SAML application in Cloudflare Zero Trust.
Prerequisites
- Admin access to a Salesforce account
1. Add a SaaS application to Cloudflare Zero Trust
- In Zero Trust, go to Access > Applications.
- Select SaaS.
- For Application, select Salesforce.
- For the authentication protocol, select SAML.
- Select Add application.
- Fill in the following fields:
- Entity ID:
https://<your-domain>.my.salesforce.com
- Assertion Consumer Service URL:
https://<your-domain>.my.salesforce.com
- Name ID format: Email
- Entity ID:
- Copy the SSO endpoint and Public key.
- Select Save configuration.
- Configure Access policies for the application.
- Select Done.
2. Create a certificate file
- Paste the Public key in a text editor.
- Wrap the certificate in
-----BEGIN CERTIFICATE-----
and-----END CERTIFICATE-----
. - Set the file extension as
.crt
and save.
3. Add a SAML SSO provider to Salesforce
- In Salesforce, go to Setup.
- In the Quick Find box, enter
single sign-on
and select Single Sign-On Settings. - In SAML Single Sign-On Settings, select New.
- Fill in the following fields:
- Name: Name of the SSO provider (for example,
Cloudflare Access
). Users will select this name when signing in to Salesforce. - API name: (this will pre-populate)
- Issuer:
https://<your-team-name>.cloudflareaccess.com
, where<your-team-name>
is your team name. - Identity Provider Certificate: Upload the
.crt
certificate file from 2. Create a certificate file. - Entity ID:
https://<your-domain>.my.salesforce.com
- SAML Identity type: If the user’s Salesforce username is their email address, select Assertion contains the User’s Salesforce username. Otherwise, select Assertion contains the Federation ID from the User object and make sure the user’s Federation ID matches their email address.
Configure Federation IDs
- In the Quick Find box, enter
users
and select Users. - Select the user.
- Verify that the user’s Federation ID matches the email address used to authenticate to Cloudflare Access.
- In the Quick Find box, enter
- Identity Provider Login URL: SSO endpoint provided in Cloudflare Zero Trust for this application.
- Name: Name of the SSO provider (for example,
- Select Save.
4. Enable Single Sign-On in Salesforce
Enable Cloudflare Access as an identity provider on your Salesforce domain:
- In the Quick Find box, enter
domain
and select My Domain. - In Authentication Configuration, select Edit.
- In Authentication Service, turn on the Cloudflare Access provider.
- In the Quick Find box, enter
- Configure Single Sign-On settings:
- In the Quick Find box, enter
single sign-on
and select Single Sign-On Settings. - (Optional) To require users to login with Cloudflare Access, turn on Disable login with Salesforce credentials.
- Turn on SAML Enabled.
- Turn on Make federation ID case-insensitive.
- In the Quick Find box, enter
To test, open an incognito browser window and go to your Salesforce domain (https://<your-domain>.my.salesforce.com
).