Connect the Two Orgs
Este conteúdo não está disponível em sua língua ainda.
Lab for chapter 7, Salesforce as the Identity Provider, in Securing Salesforce: Identity and Access. The practice asks why each of these steps matters; this page is how to do them.
| You’ll build | The identity provider’s half of single sign-on: the service provider org registered as a SAML external client app, Priya allowed to use it, and two working logins, one from each side |
| Time | About 60 minutes (measured in the lab test, November 2026) |
| Org | Both orgs: the identity provider org for the app and Priya’s access, the service provider org for the logins and the checks |
| Start from | The end of chapter 6’s lab: the service provider’s SAML setting, Priya’s Federation ID E10442 there, the login page button, and your pairs page |
| Files | Three small metadata files you make yourself (step 4). Nothing to download from us |
| You need | The Salesforce CLI (sf), your authenticator app for the admins’ logins, and Chrome (or another browser with developer tools) |
| Tested | Winter ‘27, November 2026 |
Before you start
Section titled “Before you start”- Log in to both orgs as the admin, in two tabs of your normal browser, and check the logos. Every step says which org it’s in.
- Open your pairs page from chapter 6. You’ll fill in the blanks at the end.
- Install the Salesforce CLI if you don’t have it: Install the Salesforce CLI (opens in a new tab).
Step 1: Give Priya her Federation ID in the identity provider org
Section titled “Step 1: Give Priya her Federation ID in the identity provider org”-
In the IdP org, from Setup, in Quick Find, enter
Users, select Users, then Priya Sharma, and Edit. -
Under Single Sign On Information, set Federation ID to
E10442, the same as in the service provider org, and select Save.
The same Federation ID as in the service provider org; a different username (Salesforce, Setup in a Developer Edition org, screenshot, November 2026). Full size
The identity provider sends this value for its Priya; the service provider looks for a user with the same value. Her usernames are different in each org and always will be.
Step 2: Find External Client App Manager
Section titled “Step 2: Find External Client App Manager”In the IdP org, from Setup, in Quick Find, enter External Client App, then select External Client App Manager.
You should see “Nothing to show yet”, and a New External Client App button. There’s nothing to turn on first: in the lab test, external client apps were already available in a new Developer Edition. The Settings page beside it has four switches, none of them an opt-in; leave them as they are.

Nothing to turn on first: the button is already there (Salesforce, Setup in a Developer Edition org, screenshot, November 2026). Full size
Step 3: Make the permission set
Section titled “Step 3: Make the permission set”-
In the IdP org, from Setup, in Quick Find, enter
Permission Sets, select Permission Sets, then New. -
Label:
SSO to the service provider org. Description:Who may use single sign-on from this org into the service provider org (lab). License: leave —None—. Select Save. -
Select Manage Assignments, Add Assignment, tick Priya Sharma, Next, keep No expiration date, and select Assign.
-
Note the permission set’s ID from the address bar: it starts with
0PS. Or ask the CLI (step 5 logs it in):Terminal window sf data query -q "SELECT Id FROM PermissionSet WHERE Label = 'SSO to the service provider org'" -o idp-org
Step 4: Make the project
Section titled “Step 4: Make the project”On your computer, make a folder, for example saml-eca-lab, with the five files from the practice, step 5: sfdx-project.json, package.xml, and the three files under force-app/main/default/. Copy them exactly.
In the SAML file, replace the three capitals:
| In the file | Your value | Where it comes from |
|---|---|---|
SP_ENTITY_ID | https://bluefin-lab-sp-dev-ed.develop.my.salesforce.com | The service provider’s setting, Entity ID (chapter 6, step 4) |
SP_ACS_URL | https://bluefin-lab-sp-dev-ed.develop.my.salesforce.com | The service provider’s Endpoints, Login URL (chapter 6, step 4) |
PERMISSION_SET_ID | 0PS… | Step 3 |
In the lab test, both addresses were the service provider org’s My Domain address, exactly as above with your own name in it.
Step 5: Deploy
Section titled “Step 5: Deploy”-
In a terminal, in the project folder, log the CLI in to the IdP org as its admin. A browser window opens: log in there, with MFA.
Terminal window sf org login web --alias idp-org --instance-url https://bluefin-lab-idp-dev-ed.develop.my.salesforce.com -
Deploy:
Terminal window sf project deploy start --manifest package.xml -o idp-orgYou should see Status: Succeeded and three components Created: the app, its policies, and its SAML policies.
-
In External Client App Manager, refresh: ServiceProviderOrg is there, Local, Enabled.
Watch out. In the lab test (Winter ‘27, November 2026) the deploy succeeded with no warning, but the permission set in the SAML file was not applied: the app’s Selected Permission Sets stayed empty, so Priya couldn’t use it. Step 6 adds it by hand. Check it every time.
Step 6: Give Priya the app, and read its SAML values
Section titled “Step 6: Give Priya the app, and read its SAML values”-
In External Client App Manager, open ServiceProviderOrg, and select the Policies tab, then Edit.
-
Under App Policies, Select Permission Sets, move SSO to the service provider org to Selected Permission Sets, and select Save.

Who may use the app. In the lab test, this had to be added here after the deploy (Salesforce, Setup in a Developer Edition org, screenshot, November 2026). Full size
-
On the same tab, open SAML Policies and check the values against your pairs page: Entity ID and ACS URL (the service provider’s address), Subject Type Federation ID, Signing Algorithm SHA256, IdP Certificate Default IdP Certificate. Issuer is empty: it defaults to this org’s My Domain address, which the service provider already trusts.
-
Open SAML Login Info and copy the IdP-Initiated Login URL:
https://bluefin-lab-idp-dev-ed.develop.my.salesforce.com/idp/login?app=and the app’s ID. You need it in step 9.
The IdP-Initiated Login URL starts the login from this org (Salesforce, Setup in a Developer Edition org, screenshot, November 2026). Full size
You can read and change every SAML value here; the CLI retrieve isn’t needed to see them.
Step 7: The first login, from the service provider
Section titled “Step 7: The first login, from the service provider”-
Open a private window, then the developer tools (in Chrome: View, Developer, Developer Tools), and select Network. Tick Keep log, so the list survives the pages changing.
-
Go to your SP org’s address and select Log in with IdP org.
You should see the IdP org’s login page: “To access this page, you have to log in to Salesforce.”
-
Log in as Priya, with her IdP username and password. A private window is a new browser, so Salesforce may email a code (device activation); enter it.
-
Salesforce may ask again, this time for the SP org: a second emailed code. Enter it.
You should see the SP org’s home page, with its logo: “Good morning, Priya.”

Which org? The logo says the service provider. Who? Priya (Salesforce, a Developer Edition org, screenshot, November 2026). Full size
Ask the two questions: which org are you in, and who are you logged in as? The logo says the service provider; the name says Priya: the service provider’s Priya, found by her Federation ID.
Tip. In a new browser, single sign-on asked for two emailed codes: one at the identity provider, then one at the service provider. The service provider’s SAML Assertion Validator (step 11) shows why: Priya proved herself with a password and an emailed code, which Salesforce counts as weak, and only a strong method in the answer lets the service provider skip its own check.
Step 8: Read the answer
Section titled “Step 8: Read the answer”-
In the Network list, type
method:POSTin the Filter box, then select Doc. Only a few rows are left. -
Select the row named after your SP org’s address, status 302. Its Headers show the Request Method POST, and Origin the IdP org’s address: the browser carried the answer from the identity provider’s page.
-
Select Payload. You see RelayState and SAMLResponse, a long block of letters and numbers: the answer, encoded.

The answer travels as SAMLResponse in a form the browser posts. Its value is hidden here (Google Chrome developer tools, showing a Salesforce Developer Edition org, screenshot, November 2026). Full size
Watch out. Open only the row named after the service provider. The row named after the identity provider is Priya’s login form, and its payload holds her password. And hide the value of anything named
sidbefore you share a screenshot: it’s a session ID.
-
To read the answer, select view source, copy everything after
SAMLResponse=, and decode it from Base64 with any tool you trust on your own computer (on a Mac,pbpaste | base64 -D). It’s XML. Find these and check them against your pairs page:In the answer In the lab test The pair Issuerthe IdP org’s address Who’s speaking Audiencethe SP org’s address Who it’s for RecipientandDestinationthe SP org’s address, the Login URL Where answers go ds:Signature, twiceRSA-SHA256, with the IdP’s self-signed certificate inside How to check it NameIDE10442Who it is It’s valid for a few minutes only: in the lab test, from 30 seconds before it was made to 5 minutes after.
Tip. The identity provider sends more than the
NameID. With no attributes set up, Salesforce’s answer also carried Priya’s identity provider user ID, username and email address. Know what crosses to the service provider.
Step 9: Start at the identity provider
Section titled “Step 9: Start at the identity provider”-
In the private window, Priya is still logged in at the identity provider. Paste the IdP-Initiated Login URL from step 6 into the address bar.
You should see the SP org’s home page as Priya (perhaps after an emailed code).
-
In the IdP org, as Priya, open the App Launcher and search for
ServiceProviderOrg.You should see, in the lab test: No results.
Tip. In the lab test, the app didn’t appear in Priya’s App Launcher, though she had it through her permission set. The IdP-Initiated Login URL from the app’s SAML Login Info worked.
Step 10: Log out of one org, and look at the other
Section titled “Step 10: Log out of one org, and look at the other”-
In the private window, in the SP org, select Priya’s picture and Log Out.
You should see the SP org’s own page, Log In Using, with Log in with IdP org and Log In with a Different Account.
-
In the same window, go to your IdP org’s address.
You should see the IdP org’s home page, as Priya, with no login.

After logging out of the service provider, Priya is still logged in here (Salesforce, a Developer Edition org, screenshot, November 2026). Full size
Logging out of the service provider didn’t log Priya out of the identity provider. That’s module 4’s point: without single logout, each org keeps its own session. If you’d left Single Logout Enabled ticked in chapter 6, this step would end on the identity provider’s “Logout Error” page instead.
Step 11: Break it on purpose
Section titled “Step 11: Break it on purpose”You’ll make the Federation IDs differ only in a capital letter, and watch what the setting from chapter 6 does. Use the admin tab for the changes, and the private window, where Priya is still logged in at the identity provider, for the logins.
-
In the SP org, change Priya’s Federation ID to
e10442, lower case (Users, Priya Sharma, Edit). -
In the private window: Log Out in the SP org, then paste the IdP-Initiated Login URL again. Priya is still logged in at the identity provider, so you go straight in.
You should see the SP org’s home page: Make Federation ID case-insensitive is on, so the case doesn’t matter.
-
In the SP org, Single Sign-On Settings, Edit, untick Make Federation ID case-insensitive, and Save.
-
Repeat step 2.
You should see “Single Sign-On Error. We can’t log you in because of an issue with single sign-on. Contact your Salesforce admin for help.”
-
In the SP org, Single Sign-On Settings, select SAML Assertion Validator.
You should see Last recorded SAML login failure, with the time, and every check Ok, and at the end, Subject: E10442.

Every check passed: the problem wasn’t the answer (Salesforce, Setup in a Developer Edition org, screenshot, November 2026). Full size
-
Put it back: Priya’s Federation ID
E10442, and Make Federation ID case-insensitive ticked again.
Watch out. A Federation ID that differs only in capital letters logs in with Make Federation ID case-insensitive on and fails with it off. The error page says only that there’s “an issue with single sign-on”, and Login History shows nothing for Priya: no user matched, so there’s nobody to log it against.
Tip. When single sign-on fails, open the SAML Assertion Validator in the service provider: it keeps the last failed answer and checks it. If every check is Ok, the answer isn’t the problem: compare its Subject with your users’ Federation IDs.
Step 12: Finish the pairs page
Section titled “Step 12: Finish the pairs page”Fill in the identity provider’s side of every pair, and where each value lives:
| Pair | Service provider (chapter 6) | Identity provider (this lab) |
|---|---|---|
| Who’s speaking | Issuer in the setting | This org’s My Domain address (the app’s Issuer, left empty) |
| Who it’s for | Entity ID | The app’s Entity ID |
| Where answers go | Login URL in Endpoints | The app’s ACS URL |
| How to check it | The IdP’s certificate, from the metadata | Default IdP Certificate, on the Identity Provider page |
| Where to send people | Identity Provider Login URL | The app’s SP-initiated endpoints, in SAML Login Info |
| Who it is | Priya’s Federation ID E10442 | Priya’s Federation ID E10442, Subject Type Federation ID |
Check your lab
Section titled “Check your lab”- ServiceProviderOrg is in External Client App Manager, deployed from your three files.
- Its Selected Permission Sets has SSO to the service provider org, and Priya has the permission set.
- Priya has
E10442in both orgs, and Make Federation ID case-insensitive is ticked in the SP org. - Priya logged in from the SP org’s button and landed in the SP org as Priya.
- You checked the answer’s Issuer, Audience, Recipient and NameID against the pairs.
- Both admins still log in with a password and MFA.
- The pairs page has no blanks.
If something went wrong
Section titled “If something went wrong”From the lab test, November 2026:
- The deploy succeeded but Priya gets an error at the identity provider. The permission set wasn’t applied: add it on the app’s Policies tab (step 6).
- “Single Sign-On Error” at the service provider. Open SAML Assertion Validator (step 11). If every check is Ok, compare the Subject with Priya’s Federation ID in the SP org, letter by letter.
- “Logout Error” at the identity provider. Single Logout Enabled is still ticked in the service provider’s setting: untick it (chapter 6, step 4).
- The app isn’t in the App Launcher. Use the IdP-Initiated Login URL (step 9).
- No row in the Network list. Keep log wasn’t ticked, or the developer tools were opened after the login: start again in a new private window.
- You changed something in the wrong org. Check the logo, change it back.
Keep or clean up
Section titled “Keep or clean up”Keep everything. Later chapters use both orgs again. Log Priya out when you’re done, and close the private window.
What you just proved
Section titled “What you just proved”One org vouched for Priya, and the other believed it. The identity provider signed an answer that said who’s speaking, who it’s for, where it goes and who it is; the service provider checked every one of those against what it already knew from chapter 6, and found its own Priya by a Federation ID that both sides keep the same. You watched the answer cross in the browser, you read it, and you broke it with one capital letter. And through all of it, both admins still had their own way in.
Next lab: chapter 8, See Scopes Work.
