How to set up SAML of Salesforce and Azure Active Directory.
Table of Contents
To add Salesforce from the gallery:
In the Azure portal, on the left navigation panel, click the Azure Active Directory icon.
Navigate to Enterprise applications. Then go to All applications.
To add new application, click New application button on the top of the dialog.
In the search box, type Salesforce, select Salesforce from result panel and click Add.
Azure Active directory
Add a new application
To configure Azure AD single sign-on with Salesforce:
- In the Azure portal, on the Salesforce application integration page, click Single sign-on.
- On the Single sign-on dialog, select Mode as SAML-based Sign-on to enable SSO.
- Edit the first option: Basic SAML Configuration.
- In all three required fields (the Identifier (Entiry ID) field, Reply URL field, and Sign on URL field), enter your Salesforce URL. It should appear like this: https://<subdomain>.my.salesforce.com
- When finished, click Save at the top.
- Navigate back to the Single Sign-On page.
- Edit the second option, User Attributes & Claims.
- Edit the Name Identifier Value by switching the format from Email Address to Unspecified.
- Change the source attribute from user.userprincipalname to user.objectid.
- Click Save at the bottom.
- Leave all other claims as is and go back to the Single sing-On page.
- In the third option, SAML Signing Certificate, download the Federation Metadata XML file.
- Save this file to your computer. You'll need it later.
Configuring Salesforce for single sign-on
- Open a new tab in your browser and log in to your Salesforce Administrator account. In the menu on the top, click Setup.
- In the navigation pane on the left, click Security Controls, then Single Sign-On Settings.
From the Single Sign-On Settings section, perform the following steps:
- Select Edit, then SAML Enabled. Click Save.
- Click New from Metadata File.
- Upload the XML file you saved in the steps above. then click Create. Once created, you'll see a screen similar to the one below.
- You can change the name as per your org's requirements if you want. then scroll down to SAML Identity Type and select Assertion contains the Federation ID from the User Object.
- Change the Service Provider Initiated Request Binding from HTTP Redirect to HTTP Post.
- Uncheck the Single Logout Enabled box if checked.
- Click Save.
- In the Quick Find box on the left hand side of the screen, type My Domain and click.
- Scroll down until you see Authentication Configuration and click Edit.
- In the Authentication Service section, set it to the SAML Single Sing-On you just created in the previous section. Then click Save.
- Now we need to configure user provisioning in Azure.
Enable automated user provisioning
Configure automatic user account provisioning
The objective of this section is to outline how to enable user provisioning of Active Directory user accounts to Salesforce.
- In the Azure portal, browse to the Azure Active Directory > Enterprise Apps > All applications section. If you've already configured Salesforce for single sign-on, search for your instance of Salesforce using the search field.
- Select your instance, then select the Provisioning tab.
- Set the Provisioning Mode to Automatic.
Under the Admin Credentials section, provide the following configuration settings:
In the Admin Username text box, type a Salesforce account name that has the System Administrator profile in Salesforce.com assigned.
In the Admin Password text box, type the password for this account.
To get your Salesforce security token, open a new tab and sign in to the same Salesforce admin account. On the top right corner of the page, click your name, then click Settings.
- On the left navigation pane, click My Personal Information to expand the related section, then click Reset My Security Token.
- On the Reset Security Token page, click the Reset Security Token button.
Check the email inbox associated with this admin account. Look for an email from Salesforce that contains the new security token.
Copy the token, go to your Azure AD window, and paste it into the Secret Token field.
In the Azure portal, click Test Connection to ensure Azure AD can connect to your Salesforce app.
In the Notification Email field, enter the email address of a person or group who should receive provisioning error notifications, and check the checkbox. Click Save.
Under the Mappings section, select Synchronize Azure Active Directory Users to salesforce.com.
In the Attribute Mappings section, scroll down and click Username. This should open a module that allows you to change you mapping.
- In the module, change the Mapping type from Direct to Expression.
- Replace the Expression box text with Append([userPrincipalName], ".simp")
- Change the Matching Precedence from 1 to 2. Your result should look like the screenshot below.
- Click Ok.
- Scroll down to the Attribute list and click Add New Mapping.
- On the right hand side, change the fields to match the below:
- Source Attribute: Objectid
- Target Attribute: FederationIdentifier
- Match Object using this Attribute: Yes
- Matching Precedence: 1
- Once complete, click Ok.
- Once again, click Username. Change the property Match objects using this attribute from Yes to No.
- Your completed attribute list should look similar to the screenshot below.
- If needed, you can add more attributes like Title, Department, Manager, etc. To do so, click Add New Mapping and change the Source Attribute and Target Attribute.
- When finished, click Save.
- Navigate back to the main Provisioning window.
- To enable Azure AD provisioning, change the Provisioning Status to On in Settings. The Scope will always be Sync only assigned users and groups.
- Click Save. The sync will run every 40 minutes.
Create two groups in Azure or in Premise AD (if you are syncing users from Active Directory). Give the groups names similar to Simpplr_Admin and Simpplr_Users. These are required to control user access.
Once groups are created, Add a group in the application.
Click Add user and search for the group we created above, like Simpplr Admin.
Click Select Role (Role in Azure is Profile in Salesforce). Select System Administrator and then assign.
Repeat the same steps for Simpplr User group as well.
Any user who is added to the group will get access to the application. If removed, the user will become inactive.
Mapping fields from Azure to Simpplr
After user provisioning, you'll likely want to sync fields such as Joining date and Birthdays from Azure AD to Simpplr. Follow the steps below to do so.
Use the Custom attribute in the on-premise Active Directory
Use the existing msDS-cloudExtensionAttribute1
Map/Fill the Birthday for all active users. Click Save.
Use another existing attribute msDS-cloudExtensionAttribute2 for HireDateas well. Click Save.
Add the date in the format YYYY-MM-DD only.
Azure AD Connect sync: Directory extensions
You can use directory extensions to extend the schema in Azure Active Directory with your own attributes from on-premises Active Directory.
Open Microsoft Azure Active Directory connect utility.
You configure which additional attributes you want to synchronize in the customsettings path in the installation wizard.
- The Available Attributes box is case-sensitive.
- Once the attributes are added, click Next, then Save.
Make changes on the Azure portal
In the Azure portal on the left navigation panel, click Azure Active Directory icon.
Navigate to Enterprise applications. Then go to All applications.
Search for Salesforce application for which you have configured SSO and Provisioning.
Navigate to Provisioning and scroll down.
- Look for Mapping and click Synchronize Azure Active Directory Users to Salesforce.com.
- From the new window, scroll down and click the checkbox next to Show advanced options. Then click Edit attribute list for salesforce.com.
- Scroll down and type the new field into the box. For example, Birth_Date__c and choose String from the dropdown list. click Add Attribute, then click Save.
- Now add this attribute to the AD custom attribute list. From the previous screen, click Attribute Mapping and scroll down until you see Add New Mapping. Click it.
- Select the source attribute as Extension Attribute. you'll sync this for the Hire Date or Birthday field from the on-premise AD.
- Select the target attribute as Birth_Date__c and click Okay. Do the same for any other fields you create such as Joining_Date__c.
- Click Save on the Attribute Mapping page.
Make the changes in Simpplr
- Log in to Simpplr as a System admin.
- Click your user profile image and navigate to Manage application > People > User syncing.
- Check the boxes next to Hire Date, Birthday, or any other fields you've set up in AD. Then click Save. The sync will typically take up to 24 hours before you can see the changes for End users.