Salesforce SSO Integration
Published: 2024-04-06 19:29:59


### Setting Up SSO for 2 different Salesforce Organization
Setting up Salesforce as an Identity Provider (ORG 1). 
Org 1: Enable Identity Provider in Salesforce:
1. Log in to your Salesforce org.
2. Navigate to Setup > Identity > Identity Provider.
3. Click Enable Identity Provider.
4. Click Save

![Salesforce Identity Provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dyvavd2df1xmjb9r6ntm.png)

5. Go to Remote Site Settings in ORG 2 (SP) > Click “New Remote Site Setting” and provide the necessary information. 
6. For the “Remote Site URL” on the picture above, go back to ORG 1 > Identity Provider. Now copy the Salesforce Identity URL Settings and paste it in the “Remote Site URL” in number 5 above. 

![Salesforce Remote Site Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x96ygmh3xov84pis26c3.png)
Back to ORG 2 (SP):
7. Go to setup > Identity > Single Sign on Settings. 
8. Click on “New from Metadata URL”

![Identity Provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frdor7fvis15gbvlmtu7.png)
9. Follow the example on number 6 above since we are using the same URL. Copy the URL and paste it as seen in the picture below and click on “Create”. 

![Single Sign On Screen ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wy40pdt8yed7b1wfkybj.png)
10. Under the “SAML Identity type”, Select “Assertion contains the federation ID from the User Object”. 

![Single Sign On setting screens](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wzzn56761vjhb469xasr.png)
Back to ORG 1 (IDP)
Setting up the Connected App on Salesforce Org 1 (IDP)
1. Go to setup
2. Under Platform Tools tab, select Apps
3. Click App Manager
4. New Connected App

![Lightning Experience App Manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fys1opnwey4raah0hg9.png)
5. Configure the Connected App: 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3jrqm1ma48n0e0fbdvi.png)
6. Under Web App Settings, Click on SAML checkbox and provide the required data. This will be used to establish the SSO. 

![Manager Connected App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jhlred87rj4nws4nn8k.png)

7. For the Entity ID Field and ACS URL, go to the ORG 2 (SP), under identity > Single Sign On, and copy the following URL as seen on the picture below.
For Entity ID. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bvry6e694zryjl73d4nd.png)
For ACS URL, Copy the Login URL

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1g1qh1og7knumm8nhyl3.png)
8. For Subject Type, “Change Select type” and set to “Federation ID” 
9. Click Save
10. Click on Manage. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9a82ssak0qagvzhyh01d.png)
11. Scroll down to Profile section and Click on “Manage Profile” .
12. Select a Profile to assign to the connected App. Checked System Administrator, then click Save. This will add the profile to the connected App. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bus0bqawzkdeft3yj89.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4hadazddxiiyfg9ijsr.png)
13. Go to ORG 2, Under setup, search for “My domain” scroll down to click on “Edit” under the “Authentication Configuration”. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/flh8ha8s7cdastkoqbwv.png)
14. Check the second box. This is the 2 org you are using as the IDP. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00r66tf535147e1929ru.png)
15. Click Save
16. Go to Org 2, Under Setup > Users. Edit your username. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lmd8yky7k53bsu6979em.png)
17. Scroll down to “Single Sign on Information Section” and paste your Federation ID code. Note: Your federation ID should be unique e.g (crawlwise@gmail.com). This can be any attribute, as long as it is unique. 
18. To test your connection, go to ORG 1 (IDP) > App Manager > Scroll down and select the connected app you have created. From the dropdown option, select “Manage”. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ysgcd2fi0yh9cug5ztd.png)
19. Scroll down and click on the Idp-initialted-login-url. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjrv8vzv5fy824hwcw8r.png)
20. This should log you in to the first org without any issues. 

If you encounter any issues during the login process using the idp-initiated Login URL, please check through steps again to ensure everything is done correctly.
 
**Contact Me:**
**Whatsapp Number:** +2348078339783
**Email Address:** crawlwise@gmail.com
**Linkedin Account:** www.linkedin.com/in/albert-eromosele-47321370