Chapter 117% of the exam55 min
Identity Management Concepts
The ideas behind every identity design: authentication patterns from passwords to SAML, OpenID Connect, social sign-on and delegated authentication; authentication, authorization and accountability; how two systems come to trust each other through issuers, certificates and endpoints; the ways to provision users; and how to troubleshoot single sign-on when it fails.
By the end of this chapter you can
- Describe common authentication patterns and understand the differences between each one
- Describe the building blocks that are part of an identity solution (authentication, authorization, accountability) and how to enable
- Describe how trust is established between two systems
- Given a scenario, recommend the appropriate method for provisioning users in Salesforce
- Given a scenario, troubleshoot common points of failure that may be encountered in a single sign-on solution (SAML, OAuth, etc.)
Authentication patterns
Scenario: A manufacturer's employees sign in to Microsoft Entra ID every morning, its contractors live in an LDAP directory, and its customers want to sign in with Google. Each group needs a different way to prove who they are.
Who does what
- An identity provider (IdP) is a trusted service that authenticates the user. A service provider (SP) hosts apps and accepts the identity the IdP vouches for.
- Single sign-on (SSO) lets a person log in once and use other apps without logging in again. Social sign-on lets them log in with an account from a provider such as Google or Facebook.
- Salesforce can be a service provider (inbound SSO: users log in elsewhere, then reach Salesforce) and an identity provider (outbound SSO: users log in to Salesforce, then reach other apps).
The main patterns
| Pattern | How it works | Typical use |
|---|---|---|
| Username and password with MFA | The user signs in on the My Domain login page. MFA is required for every user who logs in to the Salesforce UI | Users with no corporate IdP; break-glass admin accounts |
| SAML SSO, SP-initiated | The user goes to Salesforce first. Salesforce sends a SAML request through the browser to the IdP, which authenticates the user and returns an assertion | Users who start from a Salesforce link or bookmark |
| SAML SSO, IdP-initiated | The user signs in at the IdP's portal, which posts an assertion to Salesforce's Login URL | Employees who start their day in the IdP's app launcher |
| OpenID Connect | An authentication layer on top of OAuth 2.0. Salesforce, as the relying party, redirects to the provider and receives an ID token | Modern cloud IdPs that support OIDC |
| Social sign-on | An authentication provider such as Google, Facebook or Apple signs the user in; a registration handler creates or updates the user | Customers on Experience Cloud sites |
| Delegated authentication | Salesforce calls a web service you host, which checks the credentials against your own store and answers yes or no | Legacy: credentials must stay in an on-premises store and SAML or OIDC isn't possible |
| OAuth 2.0 token exchange | An app swaps a token from an external IdP for a Salesforce token; a token exchange handler maps the token's subject to a user | Apps that already hold an external IdP's token |
| Passwordless and Lightning Login | Customers log in to sites with a one-time code or passkey; employees with Salesforce Authenticator | Reducing password use |
- SAML is an XML-based protocol. The IdP's assertion says the user is authenticated and can carry attributes about them.
- OAuth 2.0 lets applications share data securely after the user authorizes it. On its own it isn't an authentication protocol.
- Desktop SSO, such as Windows sign-in, is done by the IdP, which then sends SAML to Salesforce.
- Login Discovery shows an identifier-only login page. A handler looks at the email or phone number entered and either asks for a password or sends the user to the right IdP.
- The SOAP API
login()call, which uses a username and password, is retiring in Summer '27 and is off by default in orgs created from Winter '26.
Exam tip: "Users start their day in the corporate portal" is IdP-initiated SAML. "Users click a Salesforce link in an email" needs SP-initiated SAML. "Log in with Google" is social sign-on through an authentication provider.
Authentication, authorization and accountability
| Building block | Meaning | How Salesforce provides it |
|---|---|---|
| Authentication | Who a person is | My Domain login policies, SAML SSO settings, authentication providers, MFA |
| Authorization | What a person can do | Profiles, permission sets, sharing, session security levels; OAuth scopes for apps |
| Accountability | A record of what was done, and by whom | Login History, Identity Verification History, Setup Audit Trail, Field Audit Trail, Event Monitoring, Transaction Security |
- People often say "authentication" when they mean both authentication and authorization. Exam questions use this: read whether the scenario is about proving identity, granting access or tracking activity.
- Each login method gives a session a security level: standard or high assurance. Resources such as reports, dashboards and connected apps can require a high-assurance session, so a user must complete MFA first.
- Salesforce Identity features come with standard user licences. Identity Only licences exist for users who need SSO but not Sales or Service Cloud.
Exam tip: "Make sure only managers can approve discounts" is authorization. "Prove the user really is the CFO" is authentication. "Show who changed the SSO settings last month" is accountability.
How trust is established
Scenario: The manufacturer connects Salesforce to Entra ID with SAML. Each side must know enough about the other to accept its messages and reject forgeries.
SAML settings in Salesforce
Both sides must be configured: the service provider needs to know about the identity provider, and the IdP needs to know about Salesforce.
| Setting | What it is |
|---|---|
| Issuer | The IdP's identifier, also called its entity ID. It must match the issuer in each assertion |
| Identity Provider Certificate | The IdP's certificate, used to validate the signature on its responses |
| Entity ID (Salesforce's) | The issuer of Salesforce's SAML requests and the expected audience of responses. Use your My Domain URL |
| Identity Provider Login URL | Where Salesforce sends SAML requests for SP-initiated login |
| Login URL (in the Endpoints section) | Where the IdP posts its responses: the Recipient or assertion consumer service URL |
| Request signing certificate | Salesforce's certificate for signing the requests it sends |
| Assertion decryption certificate | Salesforce's certificate for decrypting encrypted assertions |
| SAML Identity Type and Location | Whether the assertion carries the Username, Federation ID or User ID, and where: the Subject NameID or an attribute |
Signing and encryption
- Signing proves who sent a message and that it wasn't changed. The IdP signs; Salesforce validates the signature with the IdP's certificate.
- Encryption keeps the assertion confidential. The IdP encrypts it for Salesforce, and Salesforce decrypts it with its own certificate's private key.
- Salesforce's self-signed certificates expire after 1 year with 2048-bit keys or 2 years with 4096-bit keys. Private keys can't be exported through the API.
- Triple DES is no longer supported for SAML responses; use AES 128 or AES 256.
Other trust rules
- My Domain is required for SSO and for authentication providers. My Domain can also block logins through login.salesforce.com.
- The Federation ID links a Salesforce user to the IdP's user. It must be unique in the org, and the same person can use the same Federation ID in several orgs.
- OpenID Connect trust: register an app at the provider, put its client ID and secret into the Salesforce authentication provider, and give the provider Salesforce's Callback URL. Salesforce checks the ID token's issuer and the UserInfo endpoint but doesn't validate the ID token's signature. PKCE can be turned on for several provider types.
Exam tip: Issuer = who the IdP is. Entity ID = who Salesforce is, and the audience the IdP must use. Login URL = where the IdP sends the response. A new IdP certificate must be uploaded to Salesforce, or every login fails.
Provisioning users
| Method | What it does | When to use it |
|---|---|---|
| Manual | Create users in Setup, or enable a contact as an external user | A few users |
| Data Loader or API | Create or update users in bulk, including back-filling Federation IDs | Initial loads and bulk changes |
| Standard SAML JIT | Creates or updates the user from SAML attributes the first time they log in. Needs identity mapping set to Federation ID | The IdP is the source of truth and its attributes map directly |
Custom SAML JIT (Auth.SamlJitHandler) |
Your Apex createUser and updateUser methods build the user, contact and account |
Custom fields, lookups or complex logic |
| Registration handler (Apex or flow) | Creates or updates the user when they sign in through an authentication provider | Social sign-on and OpenID Connect providers |
| Self-registration | A visitor fills in a form, and Salesforce creates a contact and user | Customer sites |
| SCIM | The IdP creates, updates and deactivates Salesforce users through standard SCIM endpoints | Managing the whole lifecycle from the IdP, before and after login |
| Identity Connect | Synchronizes Active Directory users into Salesforce | Older Active Directory deployments; see Salesforce Identity |
- JIT combines provisioning and SSO in one message and removes the need to create users in advance, but it only runs when a user logs in. It can't deactivate people who never log in again; use SCIM, the API or the IdP's provisioning for leavers.
- JIT handlers and registration handlers run as an execution user, who needs the Manage Users permission. Use a dedicated system user, not a named admin who might leave.
- An OAuth token exchange handler can also create users from an external token.
Exam tip: "Create users the first time they log in through the corporate IdP" is SAML JIT. "Users must be deactivated the moment HR removes them" needs SCIM or API-based provisioning, not JIT alone.
Troubleshooting single sign-on
Scenario: On go-live day, some employees see an error when they arrive from Entra ID, and a new customer can't finish signing in with Google.
Where to look first
- Login History records every successful and failed login, with a Status that gives the reason, such as "Failed: Audience Invalid". Its login type shows
SAML Idp Initiated SSOorSAML Sfdc Initiated SSO, and AuthenticationServiceId shows which SAML configuration or authentication provider was used. - The SAML Assertion Validator in Single Sign-On Settings checks an assertion against the configuration, including the most recent failed one.
- For authentication providers, the Test-Only Initialization URL shows the data the provider returns. Registration handler errors appear in the URL after a failed login.
- Debug logs need a trace flag on a user; class and trigger trace flags alone don't create logs.
Common SAML failures
| Status | Likely cause | Fix |
|---|---|---|
| Assertion Expired | Clock difference between IdP and Salesforce, or an old assertion | Synchronize the IdP's clock and send fresh assertions |
| Signature Invalid / Configured Certificate Mismatch | The IdP signs with a different certificate, often after a rotation | Upload the IdP's current certificate |
| Issuer Mismatched | The assertion's issuer doesn't match the configured Issuer | Make them identical |
| Audience Invalid | The audience isn't Salesforce's Entity ID | Set the IdP's audience to the Entity ID |
| Recipient Mismatched | The IdP posts to the wrong URL, often after a My Domain change | Use the Login URL from the Endpoints section |
| Username Or SSO Id Invalid | No user with that Federation ID or username, or the wrong identity type | Fix the user's Federation ID or the identity settings |
| InResponseTo Invalid | An SP-initiated response doesn't match the request, or the request expired | Start again from Salesforce |
| Replay Detected | The same assertion was sent twice | Generate a new assertion for every login |
| SAML Provision Error | JIT failed: missing attributes or a handler error | Check the attributes and debug the handler |
Avoid locking yourself out
- Don't enable SSO for every system administrator: if the integration fails, nobody can log in to fix it. Keep at least one admin with a direct login.
- A Transaction Security policy on login events that blocks by mistake can lock everyone out.
- With delegated authentication, failures appear as messages such as "Your company's authentication service is down".
Exam tip: Start with Login History: its status names the failing check. Certificate errors after a weekend usually mean the IdP rotated its signing certificate. Recipient errors usually mean the IdP posts to the wrong Login URL.
Hands-on exercise
Design single sign-on for a manufacturer
Choose the authentication patterns, trust settings and provisioning for employees and contractors.
Use a free Salesforce Developer Edition org — never a production org.
0 of 5 steps done
How to check your work: Employees use SAML SSO from Entra ID with SP- and IdP-initiated logins, keyed on Federation ID; contractors use an OpenID Connect provider or delegated authentication if nothing else is possible; Issuer, certificate, Entity ID and Login URL are exchanged; JIT or SCIM provisions users and SCIM or the API deactivates leavers; admins keep a non-SSO login; Login History and the SAML Assertion Validator are the first checks.
Domain quiz: Identity Management Concepts
10 questions from the 38 in this domain, different each time and checked as you go. Anything you miss is saved to Mistakes review.
- Questions
- 10
- Time
- Untimed
- Feedback
- After each answer
New questions each time you start, drawn from the bank, unseen ones first.