Single-Sign-On for Salesforce via SAML Assertions
Salesforce-specific notes on implementing and configuring single-sign-on via SAML
- Salesforce can act as either a Services Provider (SP) or Identity Provider (IdP)
IdP Settings
- Steps to Set it up:
- Enable MyDomain
- Set up SFDC as a SAML IdP
- Download the SFDC IdP Certificate
- Utilize this certificate and the settings in whatever Service you are creating
- Create a SAML connected App in SFDC
- Manage the Connected App to set Access Permissions using a Profile or Perm Set and the Start URL to display it in the AppLauncher
- Important Note: In order for a given Connected App to show up in the AppLauncher, it must have a
startUrlfilled
- Important Note: In order for a given Connected App to show up in the AppLauncher, it must have a
- Adjust the Connected App to add Relay State parameters to the IdP-Initiated Login URL
SP Settings
SSO Configuration
- When setting up the saml configuration for SSO (under Settings > Single Sign On), the
Entity Idjust needs to be a unique identifier for your Service. It will be given to your IDP, and used in the resulting SAML, therefore it should be unique.- Usually you can choose the URL of your Community, the URL for your My Domain, etc…
JIT Provisioning
- If you want to support JIT Provisioning, you must click the “User Provisioning Enabled” button on the specific SSO configuration
- Required User Attributes
User.UsernameUser.EmailUser.LastNameUser.ProfileId- Important Note: This doesn’t actually need to be the actual SFDC Profile ID; if your Profile names are unique, you can pass the name of the Profile and Salesforce will look up the name of the profile automatically based on the name
- Additional Portal User Attributes
Contact.AccountContact.LastNameContact.EmailUser.PortalRole=Worker- ???
- You can also create a custom JIT Provisioning Apex class for more custom provisioning needs
SSO for Communities
In order to set up SSO for Communities users, follow these steps:
- Set up a standard SAML configuration
- Modify the ACS URL (place where you send SAML messages) in your IDP to the following:
COMMUNITY_URL/login?so=ORGANIZATION_ID- Note that this is your regular ACS URL with the Community URL +
/logininstead of your My Domain
- Note that this is your regular ACS URL with the Community URL +
- Optionally set up your Community for SP-Initiated SSO