Skip to content

Interview PrepEnterprise SSO · Core

Single Sign-On ​

102. What is Single Sign-On (SSO), and why do organizations use it? ​

The short answer

SSO means a user logs in once, at a central identity provider, and can then use many separate applications without logging in again to each. Organisations use it because it is more secure and cheaper to run. There is one place to enforce MFA, passkeys and login policies. There are fewer passwords for users to reuse or forget. Disabling one account removes access everywhere when someone leaves. And there are far fewer helpdesk calls about forgotten passwords. The risk is concentration: the IdP becomes critical, so it must be strongly protected and highly available.

Without SSOWith SSO
A password per app; users reuse themOne strong login, with MFA
MFA set up app by app, if at allMFA enforced centrally
A leaver must be removed from every appDisable once at the IdP
Each app stores password hashesApps store no passwords
Login audit spread across appsOne audit log of every sign-in

103. How does SSO work across multiple applications? ​

The short answer

Each application trusts the same identity provider. When you open the first app, it has no session for you, so it redirects you to the IdP. You log in, and the IdP sets its own session cookie on its domain, then sends the app a signed assertion or ID token. The app creates its own session. When you open a second app, it also redirects you to the IdP, but this time the IdP sees its session cookie, skips the login, and immediately sends the second app an assertion. You see only a quick redirect.

identity providerIdP session cookieon login.acme.exampleexpenses appits own sessionwiki appits own sessionuser's browser①② log in once, with MFA③④⑤
Two sessions per app, one at the IdP. ① and ② The first app sends the user to log in. The IdP remembers them with its own cookie. ③ The app gets an assertion and starts its own session. ④ and ⑤ The second app does the same round trip, but the IdP's cookie lets it answer instantly.

The insight interviewers want. SSO is not one shared cookie across all apps, which browsers would not allow across different domains. It is many separate app sessions, each created from a fresh assertion, all backed by one session at the IdP.

104. What happens when a user accesses an enterprise application for the first time? ​

The short answer

The app has no session, so it redirects the user to the company's IdP, usually after asking for their email to find the right company. The user logs in with password and MFA or a passkey, and Conditional Access rules may also check their device. The IdP checks the user is assigned to this app, then sends a signed assertion with their ID, email, name and groups. The app either finds an account already created by SCIM provisioning, or creates one on the spot from the assertion, which is called just-in-time provisioning. It maps the groups to roles, and starts a session.

The steps, in order:

  1. Home realm discovery. The app asks for the email, sees @acme.example, and knows to use Acme's IdP.
  2. Redirect to the IdP with a SAML request or an OIDC authorize request.
  3. Authentication at the IdP, with MFA, and device checks if policy requires them.
  4. Assignment check. If the user is not assigned to the app, the IdP shows an error instead of sending an assertion.
  5. Consent, only if the app asks for permissions that need it and an admin has not pre-approved them.
  6. The assertion arrives at the app's callback URL, for example the ACS URL in SAML (the ACS question).
  7. Account linking. The app finds a provisioned account, or creates one just in time (the JIT question).
  8. Roles are mapped from groups or role claims.
  9. The app's session starts, and the user lands on the page they asked for.

105. What happens when an SSO session expires? ​

The short answer

There are two sessions that expire separately. When the app's session expires, the app redirects to the IdP again. If the IdP's session is still alive, the user comes straight back with a new assertion and barely notices. If the IdP's session has also expired, the user must log in again, possibly with MFA. Apps must handle this gracefully: save unsaved work, use a redirect for page loads, and for API calls from a single-page app, return 401 so the front end can trigger a re-login instead of silently failing.

App sessionIdP sessionWhat the user sees
ValidAnyNothing; the app works
ExpiredValidA quick redirect, then back in
ExpiredExpiredThe login page, perhaps MFA
ValidEnded by adminStill in, until the app session ends, unless the app gets a logout signal

The last row is a real gap. If an admin disables a user at the IdP, apps with long sessions keep them logged in. Fix it with short app sessions, back-channel logout (the OIDC logout question), SCIM deactivation, or continuous access evaluation, where the IdP pushes critical events to apps.

106. What are the common protocols used for SSO? ​

The short answer

SAML 2.0, from 2005, uses signed XML assertions passed through the browser; it is the workhorse of enterprise SaaS SSO. OpenID Connect, from 2014, uses signed JWTs on top of OAuth 2.0; it is the modern default for new apps, mobile and consumer login. Kerberos with Integrated Windows Authentication gives seamless SSO inside a Windows domain network. WS-Federation is an older Microsoft protocol still found with ADFS. OAuth 2.0 alone is not an SSO protocol, but it carries API access alongside OIDC.

ProtocolTokenTypical use
SAML 2.0XML assertionEnterprise SaaS: Salesforce, Workday, ServiceNow
OpenID ConnectJWT ID tokenNew web apps, mobile apps, consumer login
KerberosKerberos ticketsWindows domain, intranet sites, file shares
WS-FederationXML tokenOlder ADFS and SharePoint integrations
CASService ticketUniversities

107. What is the difference between SAML, OAuth 2.0, and OIDC? ​

The short answer

SAML is an authentication and attribute protocol that passes signed XML assertions through the browser; built for enterprise web SSO. OAuth 2.0 is an authorization framework that issues access tokens so apps can call APIs on a user's behalf; it does not, by itself, tell an app who the user is. OIDC is an authentication layer on OAuth 2.0 that adds a signed JWT ID token; it does SAML's job with JSON and web-friendly flows, and works well for mobile apps and APIs too.

SAML 2.0OAuth 2.0OpenID Connect
PurposeAuthentication, SSODelegated API accessAuthentication, SSO
FormatXMLAny; often JWTJSON, JWT
Signed withXML SignatureDependsJWS
Carries tokens throughBrowser POSTCode, then back channelCode, then back channel
Mobile and SPA friendlyPoorGoodGood
API accessNoYesYes, with the access token
Year200520122014
OAuth 2.0access tokens for APIs: what may this app doOpenID Connectadds the ID token: who logged inSAML 2.0a separate standardlogin with XMLassertions
Two answers to login, one to API access. OIDC is built on top of OAuth, so one flow can give you both a login and API access. SAML is an older, separate design that only does login and attributes.

108. When should an enterprise prefer SAML, and when should it prefer OIDC? ​

The short answer

Prefer SAML when the application or the customer's identity provider only supports SAML, which is still common for established enterprise SaaS and older on-premises IdPs such as ADFS, or when a customer's security team has a SAML integration process they insist on. Prefer OIDC for anything new, for mobile apps and single-page apps, when you also need API access tokens, and when you want simpler libraries and JSON instead of XML signature handling. A B2B SaaS product usually needs to support both, because its customers choose.

SituationChoose
New app, your own IdPOIDC
Mobile or SPAOIDC
Need to call APIs as the userOIDC, with OAuth access tokens
Customer's IdP is ADFS or an older systemSAML
Enterprise customer demands SAMLSAML
Selling to many enterprisesBoth (question 130)

A practical reason to like OIDC: SAML security depends on correct XML signature validation, which has produced many serious vulnerabilities, even in popular libraries. OIDC's JWT checks are simpler and harder to get wrong (SAML attacks).

109. What are SSO cookies, and how do they relate to application sessions? ​

The short answer

The SSO cookie is the identity provider's session cookie, set on the IdP's own domain such as login.acme.example. It records that the user authenticated there, when and how. Each application session is a separate cookie on that app's own domain, created after the app receives an assertion. Apps cannot see or read the IdP's cookie, and the IdP cannot see theirs. They are linked only through redirects. That is why logging out of one app does not log you out of the IdP or other apps, and why their lifetimes are configured separately.

SSO (IdP) cookieApplication session cookie
Domainlogin.acme.exampleexpenses.acme.example, wiki.example
Set byThe IdP after loginThe app after an assertion
RecordsUser authenticated, method, timeUser is in this app; app's own state
Lifetime set byIdP policy, such as 8 hours or "stay signed in"Each app
Cleared byIdP logoutApp logout

Choosing lifetimes together. A short app session with a long IdP session gives frequent invisible redirects but quick revocation. A long app session ignores IdP changes for a long time. A common pattern is an app idle timeout of 30 to 60 minutes, and an IdP session of a working day.

110. How does SSO logout work? ​

The short answer

There are three levels. Local logout ends only the current app's session; the user is still signed in at the IdP and in other apps, and clicking "log in" again works instantly. IdP logout also ends the IdP's session, so the next login asks for credentials, but other apps may still have their own sessions. Single logout ends the IdP session and tells every app to end theirs, through SAML SLO or OIDC front-channel or back-channel logout. Users usually expect the third, while most systems by default only do the first.

Logout levelApp sessionIdP sessionOther apps
LocalEndedStill activeStill active
IdPEndedEndedStill active
Single logoutEndedEndedTold to end

Decide this explicitly. On a shared computer, local logout is dangerous: the next person clicks "log in" and is in as you. On a personal laptop, single logout can annoy users by signing them out of ten tabs. Many enterprises choose single logout plus short app sessions.

111. What is Single Logout (SLO)? ​

The short answer

Single logout is the protocol feature that, when a user logs out of one app or the IdP, ends their sessions in every app that signed in through the same IdP session. In SAML, the IdP sends a signed LogoutRequest to each app's SLO endpoint, through the browser or directly, and collects LogoutResponses. In OIDC, the same job is done by front-channel or back-channel logout. SLO is fragile in practice: one app that fails to respond, browsers blocking third-party cookies, or a closed tab can leave sessions behind.

How SAML SLO runs, using redirects through the browser:

  1. The user clicks logout in the expenses app. It sends a LogoutRequest to the IdP.
  2. The IdP ends its own session and looks up every app this session logged into.
  3. It redirects the browser to each app's SLO URL in turn, with a LogoutRequest.
  4. Each app ends its session and redirects back with a LogoutResponse.
  5. When all have answered, the IdP shows "you are logged out".

If one app's endpoint is broken, the chain stops, and the remaining apps stay logged in. That is why back-channel logout, which calls servers directly, is more reliable (the OIDC logout question).

What to say in the interview. "I would implement SLO, but not rely on it alone. App sessions stay short, deprovisioning through SCIM disables accounts in each app, and high-risk apps check with the IdP more often."

Combine chapters into one PDF

Pick the chapters you want. They print in the order you pick them.

Interview Prep
Authentication & Identity
Cookies & sessions
Authentication
Tokens
OAuth & OIDC
Enterprise SSO
Directories
Authorization
Other topics
Nothing picked yet