Skip to content

The Second App, and the IdP-Initiated Flow

Module 2 of 7 in the chapter Salesforce as the Service Provider: SAML, chapter 6 of Securing Salesforce: Identity and Access. Each module stands on its own.

The question this module answers: What happens at the second app of the day, and what changes when the day starts at the identity provider?

Module 1 walked Priya’s first login of the day: a link to Salesforce, a redirect to the identity provider, a login screen, and back. Now let’s say she started her day somewhere else. She opened the company’s expense app first, signed in at the identity provider, and did her expenses. Ten minutes later she clicks a link to a Salesforce record.

Which flow kicks in? I ask this in every class. Say the words: it’s the SP-initiated flow, again.

Salesforce has never seen her today. It doesn’t matter that she logged in to the expense app; Salesforce has no session for her. So it does exactly what it did in module 1: it redirects her to the identity provider with a SAML request.

What’s different is at the identity provider. It has seen her today. She has a session there from this morning. So there’s no login screen. It writes a signed SAML response at once and sends her straight back.

The second app of the day The same four lanes as the SP-initiated flow. Priya signed in to another app this morning through the same identity provider. Step 1: she opens a Salesforce link; Salesforce hasn't seen her today and redirects her to the login server. Step 2: the login server uses the same single sign-on setting and redirects her to the identity provider with a SAML request. Step 3: the identity provider already has her session from this morning, so there's no login screen; it sends a signed SAML response straight away. Step 4: the browser posts the response; Salesforce makes the same checks and redirects her back with a session. Step 5: she's on the record. Footnote: every redirect still happens, just fast; all she sees is the record. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.58.0", "built": "2026-11-03", "id": "DGM-IAM-SP-02", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} PRIYA'S BROWSER THE IDENTITY PROVIDER SALESFORCE'S LOGIN SERVER SALESFORCE'S INSTANCE 1. Opens a Salesforce link after signing in to another app this morning No session yet Salesforce hasn't seen her today 2. Goes to the login server redirected by the instance Which identity provider? the same setting as before 3. Goes to the identity provider redirected, with the SAML request Already signed in no login screen: it has her session from this morning; sends a signed SAML response at once 4. Hands over the response posts it to Salesforce Checks it the same checks 5. Back to the record redirected, with the session The record Priya is in asks for the record redirect: go to the login server follows the redirect redirect to the IdP + SAML request SAML request SAML response, straight away posts the SAML response redirect + session asks again, with the session the record Every redirect still happens, just fast. All she sees is the record. HOW TO READ IT no login screen: the session she already has © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

Every redirect still happens. They’re just fast. All Priya sees is a flicker in the address bar, and then the record. This is the moment single sign-on earns its name: one login in the morning, and every app after that just opens.

Notice the identity provider’s session is doing the work here. Salesforce’s own session, its wristband, starts only when its checks pass. Each service provider has its own session; the identity provider holds the one that ties them together.

Now the other way to start the day. Some people go straight to the identity provider first thing: they open the company’s sign-in page, the Okta or the Entra ID or whatever the company uses, by its own address. They log in. And where does the identity provider take them?

Usually, to an app launcher: a page of buttons, one for every app they’re allowed to use. Salesforce, Workday, the expense app. When I was a contractor at one large company, the app launcher had about 20 icons on it. It was crazy. But here’s the thing about an app launcher that makes it a little bit magic.

When Priya clicks the Salesforce button, the identity provider doesn’t send her to Salesforce to start a login. It sends her there with a SAML response already in hand. No SAML request, because Salesforce never asked. The browser posts the response straight to Salesforce, Salesforce checks it, and she’s in. It’s a quicker flow.

That’s the IdP-initiated flow. Salesforce’s own description is exact: “a SAML request is unnecessary because the identity provider starts the flow with a SAML response”, which makes it “a shortened version of a service provider-initiated flow” (S3).

The IdP-initiated flow: starting at the app launcher The same four lanes. Step 1: Priya's browser goes straight to the identity provider, which shows its login screen; she signs in with MFA and gets the app launcher. Step 2: the app launcher shows a button for every app she can use; she clicks Salesforce, and the identity provider sends a signed SAML response with no request to answer. Step 3: the browser posts the response to Salesforce's login server, which makes the same checks, with nothing for it to be in response to, and redirects her with a session. Step 4: she's in Salesforce, on Home or the relay state's page. Footnote: four steps instead of five: no SAML request, so the response answers nothing; ten minutes later, the next app she opens from a link is SP-initiated again. {"author": "Steve Simpson", "blueprint": "1.0.0", "builder": "standard 1.58.0", "built": "2026-11-03", "id": "DGM-IAM-SP-03", "rights": "\u00a9 2026 Twinshark LLC. All rights reserved.", "template": "cells 0.5.0", "theme": "stevetecharc 1.4.0"} PRIYA'S BROWSER THE IDENTITY PROVIDER SALESFORCE'S LOGIN SERVER SALESFORCE'S INSTANCE 1. Goes to the identity provider first thing, its own address The login screen Priya signs in, with MFA 2. Sees the app launcher a button for every app she can use The app launcher she clicks Salesforce; a signed SAML response, with no request to answer 3. Hands over the response posts it to Salesforce Checks it the same checks, and nothing for it to be in response to 4. Into Salesforce with the session Home, or the relay state's page Priya is in opens the IdP the app launcher clicks Salesforce SAML response posts the SAML response redirect + session asks, with the session the page Four steps instead of five: no SAML request, so the response answers nothing. Ten minutes later, the next app she opens from a link is SP-initiated again. HOW TO READ IT the shortcut: a response with no request © 2026 Twinshark LLC · stevetecharc.com
Click to enlarge

Put the two pictures side by side and you can see it: the IdP-initiated flow is the SP-initiated flow with the first half cut off.

Two things follow from having no request.

The response answers nothing. In chapter 4, module 6, you saw that a response carries the ID of the request it answers, InResponseTo, so it can’t come in cold. In the IdP-initiated flow there was no request, so there’s no ID to match. Salesforce still checks everything else: the signature, the issuer, the audience, the time window, the assertion’s own ID so it can’t be used twice, and the user. That’s why the time window and the one-use ID matter so much here: they’re doing the job the request ID did.

She lands on Home, unless you say otherwise. In the SP-initiated flow, Salesforce knows which record she asked for. In the IdP-initiated flow, she clicked a button, so there’s no page to go back to. She lands on Home, unless the identity provider adds the page she should land on to its link (S4). That’s the relay state, and module 6 is all about it.

Here’s how the day really goes. Priya starts at the app launcher and clicks Salesforce: IdP-initiated. Ten minutes later, she clicks a link in an email that goes to Workday. Which flow kicks in at Workday? SP-initiated, because Workday hasn’t seen her yet. And like the second app above, there’s no login screen, because the identity provider already has her session.

So in one morning, she can use both flows without ever knowing. That’s all the flows you need to know for single sign-on with an identity provider. And it’s just some redirects. There’s nothing magical here.

Test knowledge. In my experience, know which flow is which, and which one kicks in for the second app. SP-initiated starts with a SAML request from the service provider. IdP-initiated starts at the identity provider, usually its app launcher, with a SAML response and no request. The second app you open from a link is SP-initiated, with no login screen.

This module turns the second card of the single sign-on set blue: SAML started at the identity provider. The map is in module 1.

Module 3: setting Salesforce up, so both flows work.

  • Which flows to support: SP-initiated always, because people use bookmarks and links; IdP-initiated if the company uses an app launcher.
  • Where an IdP-initiated login should land, if not Home (module 6).
  • How long the identity provider’s session lasts, since it decides how often anyone sees a login screen at all.