Headless Identity
Questi contenuti non sono ancora disponibili nella tua lingua.
Module 3 of 5 in the chapter The Login Experience, chapter 15 of Securing Salesforce: Identity and Access. Each module stands on its own.
The question this module answers: What if the company’s own app owns every screen, and Salesforce only works behind it?
When the screen isn’t Salesforce’s
Section titled “When the screen isn’t Salesforce’s”Modules 1 and 2 kept the customer on Salesforce’s page. You branded it and chose what it asks, but it was still Salesforce’s page, at the site’s address.
Now say Amara’s company has its own mobile app for orders, built by its own team, with its own look on every screen. The team doesn’t want to send her out of the app to a web page to log in, and back again. They want the login screen, the sign-up screen and the forgot-password screen to be theirs, and Salesforce to do the identity work behind them.
That’s headless identity. Salesforce: “Headless identity helps you separate back-end authentication processes from front-end identity experiences… use the power of Salesforce Customer Identity for authentication while maintaining control of the user experience in an off-platform app” (S8). The head is the screen. Headless means Salesforce provides no screen at all.
There’s still a site
Section titled “There’s still a site”Here’s the part that surprises people: “All headless identity implementations require you to set up an Experience Cloud site, but sometimes users don’t interact directly with the site” (S8). The headless endpoints are exposed and configured through the site, and the site is where her account and contact live (S8). Everything in chapter 14, the license, the profile, the account she lands on, still applies.
Salesforce describes two kinds of app (S8):
- Beside a site. The company has a site and adds a mobile app for mobile-first customers. Customers log in to both.
- Standalone. Customers only ever use the company’s own app. The site is there, but they never see it.
And one limit to know: headless identity is for customers and partners, through a site’s address. “You can’t set up headless identity for employees” (S8). Staff keep chapter 6’s single sign-on.
The flows
Section titled “The flows”Salesforce offers “headless username-password login, passwordless login, registration, forgot password, and guest user flows” (S8):
- Login, with a username and password typed into the app’s own form.
- Passwordless login, with an email or phone number and a one-time code (module 2’s idea, on your screen).
- Registration, from a form in the app; Salesforce makes the user, and saves her contact to an account (S8).
- Forgot password, with a code by email, without leaving the app (S8).
- Guest user, for visitors who haven’t logged in (the guest user itself is the Sharing and Visibility course’s chapter 14).
Under most of them is one OAuth flow: the Authorization Code and Credentials Flow. It “extends the OAuth 2.0 Authorization Code grant type” (S9): chapter 9’s authorization code, but instead of sending her to Salesforce’s page to sign in, the app hands Salesforce what she typed, and gets the code back. You turn it on for the org, then on the app’s external client app (chapter 13), with “Admin-approved users are pre-authorized” and a permission set for the app’s users (S12).
There’s a second way to build the same thing: flows that follow the OAuth 2.0 for First-Party Applications draft standard, through an authorization challenge endpoint (S8). It’s a draft standard today, so check its status before you choose it. This module follows Salesforce’s own Headless Identity APIs.
One login, step by step
Section titled “One login, step by step”Here’s headless passwordless login for an app with its own server (S9):
- Amara types her email on the app’s screen. The app’s server calls the site’s passwordless login endpoint, and Salesforce sends a code to her email.
- She types the code into the app. The app sends it, with the request’s identifier, and gets back an authorization code: “your app exchanges a request identifier and OTP for the authorization code, instead of a username and password” (S9).
- The app’s server swaps the authorization code for her access token.
- The app calls Salesforce APIs with her token, and shows her orders on its own screens. What comes back is decided by her profile and sharing, like any other user (Sharing and Visibility).
Look at the third column of the diagram. That’s the work that moved to you.
Whoever owns the screen owns the guard
Section titled “Whoever owns the screen owns the guard”On Salesforce’s login page, Salesforce decides who’s allowed to try. Once the screen is yours, the endpoint behind it is open to anything on the internet that can send a request: your app, or a script trying ten thousand email addresses.
So Salesforce doesn’t let you leave it open: “you must configure Salesforce to require either authentication or reCAPTCHA for your app’s initial request to Headless Passwordless Login API” (S10). The same rule holds for the Headless Registration API (S11). Which one depends on what kind of app you have (S10):
- A private client, an app with its own server that can keep a secret. “We recommend that you always require authentication”: the server first gets an access token for an integration user, with the
pwdless_login_apiscope (oruser_registration_apifor registration), and sends it with the first call (S9, S10, S11). reCAPTCHA can sit on top of it (S9). - A public client, a single-page app in the browser, or an app on a phone, that can’t keep a secret. Use reCAPTCHA: “For a public client, we never recommend requiring authentication because the app can’t keep the access token secure” (S10). Salesforce supports reCAPTCHA v2, v3 and Enterprise (S10).
And the same split for the app’s own secret (S12): a private client sends it from its server; a public client never sends it at all, because anything in a browser or a phone can be read. PKCE, from chapter 9: “We strongly recommend PKCE for public clients… We also recommend it for private clients” (S12).
That’s the trade, in one sentence: headless gives you every screen, and with it every check that Salesforce’s own page did for you.
Logging in with something else
Section titled “Logging in with something else”Customers don’t always remember which email they used. Headless user discovery lets them log in with “any identifier, such as an email address, phone number, or order number” (S8). An Apex handler you write finds the user, and Salesforce still sends the code to the email address on her user (S9).
That last part is what keeps it safe. An order number is printed on receipts and in emails, so it’s easy for someone else to know. It’s fine for finding her. It must never be the thing that proves it’s her: the code to her verified email does that.
When headless is worth it
Section titled “When headless is worth it”Headless is the right answer when the company’s own app must own every screen, and has a team to build and look after them. It’s the wrong answer when the reason is only the look: module 1’s branding, or an Experience Builder page, gives you the brand without taking on the guard. Module 4 puts headless beside the other choices.
Test knowledge. In my experience, know what headless identity is, that it still needs an Experience Cloud site, which flows it offers, and the difference between a private client and a public client: authentication or reCAPTCHA.
What’s next
Section titled “What’s next”Module 4: a login box on someone else’s page. Embedded login, what replaces it, and the choice between redirect, embed and headless.
What an architect decides here
Section titled “What an architect decides here”- Headless or Salesforce’s page, and whether the team can own the screens for years.
- Private or public client, and so authentication or reCAPTCHA.
- The integration user for the first call, and who owns it.
- Which identifiers find her, and which one proves it’s her.
Explore
Section titled “Explore”- Headless Identity for Customers and Partners (opens in a new tab) (Salesforce Help; checked 2026-11-21)
- Headless Passwordless Login Flow for Private Clients (opens in a new tab) (Salesforce Help; checked 2026-11-21)
- Configure Experience Cloud Settings for Headless Passwordless Login (opens in a new tab) (Salesforce Help; checked 2026-11-21)
