Newer Version Available
Best Practices for Implementing Single Sign-On
| Available in: both Salesforce Classic and Lightning Experience |
| Federated Authentication is available in: All Editions Delegated Authentication is available in: Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions Customer Portals and partner portals are not available in Database.com |
| User Permissions Needed | |
|---|---|
| To view the settings: | “View Setup and Configuration” |
| To edit the settings: | “Customize Application” AND “Modify All Data” |
- Federated authentication using Security Assertion Markup Language (SAML) allows you to send authentication and authorization data between affiliated but unrelated Web services. This enables you to sign on to Salesforce from a client application. Federated authentication using SAML is enabled by default for your organization.
-
Delegated authentication single sign-on enables you to integrate Salesforce with an authentication method that you choose. This enables
you to integrate authentication with your LDAP (Lightweight Directory Access Protocol) server, or perform single
sign-on by authenticating using a token instead of a password. You manage delegated authentication at the permission
level, allowing some users to use delegated authentication, while other users continue to use their Salesforce-managed password. Delegated authentication is set by
permissions, not by organization.
The primary reasons for using delegated authentication include:You must request that this feature be enabled by Salesforce. Contact Salesforce to enable delegated authentication single sign-on for your organization.
- Using a stronger type of user authentication, such as integration with a secure identity provider
- Making your login page private and accessible only behind a corporate firewall
- Differentiating your organization from all other companies that use Salesforce in order to reduce phishing attacks
- Authentication providers let your users log in to your Salesforce organization using their login credentials from an external service provider. Salesforce supports the OpenId Connect protocol that allows users to log in from any OpenID provider such as Google, PayPal, LinkedIn and other services supporting OpenID Connect. When authentication providers are enabled, Salesforce does not validate a user’s password. Instead, Salesforce uses the user’s login credentials from the external service provider to establish authentication credentials.
In addition, you can also configure SAML for use with portals as well as for Sites.
Delegated Authentication Best Practices
- Your organization’s implementation of the Web service must be accessible by Salesforce servers. This means you must deploy the Web service on a server in your DMZ. Remember to use your server’s external DNS name when entering the Delegated Gateway URL in the Delegated authentication section in Salesforce (from Setup, enter Single Sign-On Settings in the Quick Find box, then select Single Sign-On Settings).
- If Salesforce and your system cannot connect, or the request takes longer than 10 seconds to process, the login attempt fails. An error is reported to the user indicating that his or her corporate authentication service is down.
- Namespaces, element names, and capitalization must be exact in SOAP requests. Wherever possible, generate your server stub from the WSDL to ensure accuracy.
- For security reasons, you should make your Web service available by TLS. You must use a certificate from a trusted provider, such as Verisign or Thawte. For a full list of trusted providers, contact Salesforce.
- The IP address that originated the login request is sourceIp. Use this information to restrict access based on the user’s location. Note that the Salesforce feature that validates login IP ranges continues to be in effect for single sign-on users. For more information, see Restrict Where and When Users Can Log In To Salesforce.
- You may need to map your organization’s internal usernames and Salesforce usernames. If your organization does not follow a standard mapping, you may be able to extend your user database schema (for example, Active Directory) to include the Salesforce username as an attribute of a user account. Your authentication service can then use this attribute to map back to a user account.
- We recommend that you do not enable single sign-on for system administrators. If your system administrators are single sign-on users and your single sign-on server has an outage, they have no way to log in to Salesforce. System administrators should always be able to log in to Salesforce so they can disable single sign-on in the event of a problem.
- We recommend that you use a Developer Edition account or a sandbox when developing a single sign-on solution before implementing it in your organization. To sign up for a free Developer Edition account, go to developer.salesforce.com.
- Make sure to test your implementation with Salesforce clients such as Salesforce for Outlook, Connect for Office, and Connect Offline. For more information, see Single Sign-On for Salesforce clients.
Federated Authentication using SAML Best Practices
- Obtain the Salesforce Login URL value from the Single Sign On Settings configuration page and put it in the corresponding configuration parameter of your Identity Provider (sometimes called the “Recipient URL”).
- Salesforce allows a maximum of three minutes for clock skew with your IDP server; make sure your server’s clock is up-to-date.
- If you are unable to log in with SAML assertion, always check the login history and note the error message. Use the SAML Assertion Validator on the Single Sign On Settings configuration page to troubleshoot.
- You need to map your organization’s internal usernames and Salesforce usernames. You have two choices to do this: add a unique identifier to the FederationIdentifier field of each Salesforce user, or extend your user database schema (for example, Active Directory) to include the Salesforce username as an attribute of a user account. Choose the corresponding option for the SAML User ID Type field and configure your authentication service to send the identifier in SAML assertions.
- Before allowing users to log in with SAML assertions, enable the SAML organization preference and provide all the necessary configurations.
- Use the My Domain feature to prevent users from logging in to Salesforce directly, and gives administrators more
control over login policies. You can use the URL parameters provided in the
Salesforce Login URL value from the Single Sign-On Settings
configuration page with your custom domain.
For example, if the Salesforce Login URL is https://login.salesforce.com/?saml=02HKiP...
you can use https://<my_domain_name>.my.salesforce.com/?saml=02HKiP...
- We recommend that you use Developer Edition account or a sandbox when testing a SAML single sign-on solution. To sign up for a free Developer Edition account, go to developer.salesforce.com.
- Sandbox copies are made with federated authentication with SAML disabled. Any configuration information is preserved, except the value for Salesforce Login URL. The Salesforce Login URL is updated to match your sandbox URL, for example http://cs1.salesforce.com, after you re-enable SAML. To enable SAML in the sandbox, from Setup, enter Single Sign-On Settings in the Quick Find box, then select Single Sign-On Settings; then click Edit, and select SAML Enabled.
- Your identity provider must allow you to set the service provider’s audience URL. The value must match the Entity ID value in the single sign-on configuration. The default value is https://saml.salesforce.com.
Single Sign-On for Portals Best Practices
Customer Portals and partner portals are not available for new organizations in the Summer ’13 release or later. Use Communities instead. For more information about single sign-on and SAML for Communities, see “Configuring SAML for Communities” in Getting Started With Communities. If you continue to use portals, note the following information.
- Only SAML version 2.0 can be used with portals.
- Only Customer Portals and partner portals are supported.
- Service provider initiated login is not supported.
- Both the portal_id and organization_id attributes are required for single sign-on for portals. If only one is specified, the user receives an error.
- If both the portal_id and organization_id attributes are populated in the SAML assertion, the user is directed to that portal login. If neither is populated, the user is directed to the regular SAML Salesforce login.
- More than one portal can be used with a single organization.
Single Sign-On for Sites Best Practices
- Only SAML version 2.0 can be used with Sites.
- Only Customer Portals and partner portals are supported.
- Service provider initiated login is not supported.
- The portal_id, organization_id and siteUrl attributes are required for single sign-on for Sites. If only one is specified, the user receives an error.
- If all three of the portal_id, organization_id and siteUrl attributes are populated in the SAML assertion, the user is directed to that Sites login. If the siteUrl isn’t populated and the other two are, the user is directed to that portal login.
- More than one portal can be used with a single organization.