Tutorial: Azure Active Directory single sign-on (SSO) integration with Salesforce
In this tutorial, you'll learn how to integrate Salesforce with Azure Active Directory (Azure AD). When you integrate Salesforce with Azure AD, you can:
- Control in Azure AD who has access to Salesforce.
- Enable your users to be automatically signed-in to Salesforce with their Azure AD accounts.
- Manage your accounts in one central location - the Azure portal.
Prerequisites
To get started, you need the following items:
- An Azure AD subscription. If you don't have a subscription, you can get a free account.
- Salesforce single sign-on (SSO) enabled subscription.
Scenario description
In this tutorial, you configure and test Azure AD SSO in a test environment.
Salesforce supports SP initiated SSO.
Salesforce supports Automated user provisioning and deprovisioning (recommended).
Salesforce supports Just In Time user provisioning.
Salesforce Mobile application can now be configured with Azure AD for enabling SSO. In this tutorial, you configure and test Azure AD SSO in a test environment.
Adding Salesforce from the gallery
To configure the integration of Salesforce into Azure AD, you need to add Salesforce from the gallery to your list of managed SaaS apps.
- Sign in to the Azure portal using either a work or school account, or a personal Microsoft account.
- On the left navigation pane, select the Azure Active Directory service.
- Navigate to Enterprise Applications and then select All Applications.
- To add new application, select New application.
- In the Add from the gallery section, type Salesforce in the search box.
- Select Salesforce from results panel and then add the app. Wait a few seconds while the app is added to your tenant.
Configure and test Azure AD SSO for Salesforce
Configure and test Azure AD SSO with Salesforce using a test user called B.Simon. For SSO to work, you need to establish a link relationship between an Azure AD user and the related user in Salesforce.
To configure and test Azure AD SSO with Salesforce, perform the following steps:
- Configure Azure AD SSO - to enable your users to use this feature.
- Create an Azure AD test user - to test Azure AD single sign-on with B.Simon.
- Assign the Azure AD test user - to enable B.Simon to use Azure AD single sign-on.
- Configure Salesforce SSO - to configure the single sign-on settings on application side.
- Create Salesforce test user - to have a counterpart of B.Simon in Salesforce that is linked to the Azure AD representation of user.
- Test SSO - to verify whether the configuration works.
Configure Azure AD SSO
Follow these steps to enable Azure AD SSO in the Azure portal.
In the Azure portal, on the Salesforce application integration page, find the Manage section and select single sign-on.
On the Select a single sign-on method page, select SAML.
On the Set up single sign-on with SAML page, click the edit/pen icon for Basic SAML Configuration to edit the settings.

On the Basic SAML Configuration section, enter the values for the following fields:
a. In the Identifier textbox, type the value using the following pattern:
Enterprise account:
https://<subdomain>.my.salesforce.comDeveloper account:
https://<subdomain>-dev-ed.my.salesforce.comb. In the Reply URL textbox, type the value using the following pattern:
Enterprise account:
https://<subdomain>.my.salesforce.comDeveloper account:
https://<subdomain>-dev-ed.my.salesforce.comc. In the Sign-on URL textbox, type the value using the following pattern:
Enterprise account:
https://<subdomain>.my.salesforce.comDeveloper account:
https://<subdomain>-dev-ed.my.salesforce.comNote
These values are not real. Update these values with the actual Identifier, Reply URL and Sign-on URL. Contact Salesforce Client support team to get these values.
On the Set up single sign-on with SAML page, in the SAML Signing Certificate section, find Federation Metadata XML and select Download to download the certificate and save it on your computer.

On the Set up Salesforce section, copy the appropriate URL(s) based on your requirement.

Create an Azure AD test user
In this section, you'll create a test user in the Azure portal called B.Simon.
- From the left pane in the Azure portal, select Azure Active Directory, select Users, and then select All users.
- Select New user at the top of the screen.
- In the User properties, follow these steps:
- In the Name field, enter
B.Simon. - In the User name field, enter the username@companydomain.extension. For example,
B.Simon@contoso.com. - Select the Show password check box, and then write down the value that's displayed in the Password box.
- Click Create.
- In the Name field, enter
Assign the Azure AD test user
In this section, you'll enable B.Simon to use Azure single sign-on by granting access to Salesforce.
- In the Azure portal, select Enterprise Applications, and then select All applications.
- In the applications list, select Salesforce.
- In the app's overview page, find the Manage section and select Users and groups.
- Select Add user, then select Users and groups in the Add Assignment dialog.
- In the Users and groups dialog, select B.Simon from the Users list, then click the Select button at the bottom of the screen.
- If you are expecting a role to be assigned to the users, you can select it from the Select a role dropdown. If no role has been set up for this app, you see "Default Access" role selected.
- In the Add Assignment dialog, click the Assign button.
Configure Salesforce SSO
To automate the configuration within Salesforce, you need to install My Apps Secure Sign-in browser extension by clicking Install the extension.

After adding extension to the browser, click on Set up Salesforce will direct you to the Salesforce Single Sign-On application. From there, provide the admin credentials to sign in to Salesforce Single Sign-On. The browser extension will automatically configure the application for you and automate steps 3-13.

If you want to set up Salesforce manually, open a new web browser window and sign in to your Salesforce company site as an administrator and perform the following steps:
Click on the Setup under settings icon on the top right corner of the page.

Scroll down to the SETTINGS in the navigation pane, click Identity to expand the related section. Then click Single Sign-On Settings.

On the Single Sign-On Settings page, click the Edit button.

Note
If you are unable to enable Single Sign-On settings for your Salesforce account, you may need to contact Salesforce Client support team.
Select SAML Enabled, and then click Save.

To configure your SAML single sign-on settings, click New from Metadata File.

Click Choose File to upload the metadata XML file which you have downloaded from the Azure portal and click Create.

On the SAML Single Sign-On Settings page, fields populate automatically, if you want to use SAML JIT, select the User Provisioning Enabled and select SAML Identity Type as Assertion contains the Federation ID from the User object otherwise, unselect the User Provisioning Enabled and select SAML Identity Type as Assertion contains the User's Salesforce username. Click Save.

Note
If you configured SAML JIT, you must complete an additional step in the Configure Azure AD SSO section. The Salesforce application expects specific SAML assertions, which requires you to have specific attributes in your SAML token attributes configuration. The following screenshot shows the list of required attributes by Salesforce.

If you still have issues with getting users provisioned with SAML JIT, see Just-in-time provisioning requirements and SAML assertion fields. Generally, when JIT fails, you might see an error like
We can't log you in because of an issue with single sign-on. Contact your Salesforce admin for help.On the left navigation pane in Salesforce, click Company Settings to expand the related section, and then click My Domain.

Scroll down to the Authentication Configuration section, and click the Edit button.

In the Authentication Configuration section, Check the Login Page and AzureSSO as Authentication Service of your SAML SSO configuration, and then click Save.

Note
If more than one authentication service is selected, users are prompted to select which authentication service they like to sign in with while initiating single sign-on to your Salesforce environment. If you don’t want it to happen, then you should leave all other authentication services unchecked.
Create Salesforce test user
In this section, a user called B.Simon is created in Salesforce. Salesforce supports just-in-time provisioning, which is enabled by default. There is no action item for you in this section. If a user doesn't already exist in Salesforce, a new one is created when you attempt to access Salesforce. Salesforce also supports automatic user provisioning, you can find more details here on how to configure automatic user provisioning.
Test SSO
In this section, you test your Azure AD single sign-on configuration with following options.
Click on Test this application in Azure portal. This will redirect to Salesforce Sign-on URL where you can initiate the login flow.
Go to Salesforce Sign-on URL directly and initiate the login flow from there.
You can use Microsoft My Apps. When you click the Salesforce tile in the My Apps portal, you should be automatically signed in to the Salesforce for which you set up the SSO. For more information about the My Apps portal, see Introduction to the My Apps portal.
Test SSO for Salesforce (Mobile)
Open Salesforce mobile application. On the sign-in page, click Use Custom Domain.

In the Custom Domain textbox, enter your registered custom domain name and click Continue.

Enter your Azure AD credentials to sign in to the Salesforce application and click Next.

On the Allow Access page as shown below, click Allow to give access to the Salesforce application.

Finally after successful sign-in, the application homepage will be displayed.

Next steps
After you configure Salesforce, you can enforce Session Control, which protects exfiltration and infiltration of your organization’s sensitive data in real time. Session Control extends from Conditional Access. Learn how to enforce session control with Microsoft Defender for Cloud Apps.
Maklum balas
Kirim dan lihat maklum balas untuk