How SSO works
One login, many apps — because everyone trusts the same doorman.
Single Sign-On centralizes authentication at an Identity Provider (IdP). Applications (Service Providers) don't check passwords themselves — they redirect to the IdP, which authenticates the user once and returns a signed assertion or token. Every subsequent app reuses that existing IdP session, so the user logs in only once.
Hit the app
The user opens a Service Provider (SP) app — say a company wiki or email — that requires authentication. The SP finds no local session for this user yet, so it can't serve the protected page. Crucially, the SP itself stores no password to check; it delegates that job entirely.
Redirect to the IdP
Rather than showing its own login form, the app redirects the browser to the trusted Identity Provider (IdP). The redirect carries a request identifying which SP is asking and what it wants back. This handoff is the heart of SSO: authentication is centralized at one party everyone trusts.
Authenticate once
The user proves who they are to the IdP with a password, and often a second factor. If the user already authenticated to the IdP earlier — because a live IdP session cookie exists in the browser — this whole step happens silently with no prompt. That existing session is exactly why the second and third apps never ask again.
Signed assertion
The IdP builds a cryptographically signed statement vouching for the user's identity and attributes. With SAML this is an XML assertion; with OIDC it's a JSON ID token (a JWT). The signature, made with the IdP's private key, is what lets the SP trust it without ever sharing a password.
Validate and grant
The browser delivers the assertion to the SP, which validates the signature against the IdP's public key and checks it hasn't expired or been replayed. Because the trust is pre-established, no back-channel call to the IdP is needed to prove authenticity. The SP then reads the user's identity from the assertion and creates its own local session.
Access granted
The user is in, and the SP now serves protected pages from its local session. When the user opens a second app, that app redirects to the same IdP, which sees its live session and returns a fresh assertion instantly. The result is one login granting seamless access across many apps.
The problem: a password per app doesn't scale
Imagine a company where every employee uses a dozen internal tools — email, chat, the wiki, the HR portal, the deploy dashboard, the expense system. If each app manages its own usernames and passwords, the pain compounds fast. Users juggle a dozen credentials and reuse weak ones. Every app becomes its own place a password database can leak. When someone leaves, IT has to remember to disable them in a dozen systems, and inevitably misses one. Enforcing a policy like "everyone must use 2FA" means re-implementing it a dozen times.
Single Sign-On (SSO) solves all of this by moving authentication out of the individual apps and into one central authority. The user proves who they are *once*, to that authority, and every app trusts the authority's word instead of checking credentials itself. One login, many apps.
The key conceptual shift is that the app *stops being in the identity business*. It no longer stores passwords or runs a login form. Instead it becomes a consumer of identity assertions issued by a trusted third party. That separation is what makes centralized policy, instant offboarding, and a single strong login possible.
The two roles: Identity Provider and Service Provider
SSO is a relationship between two roles that must be set up to trust each other in advance.
The Identity Provider (IdP) is the central authority that authenticates users and issues signed proofs of identity. It owns the user directory, runs the actual login (password, 2FA, biometrics), and holds the live user session. Okta, Microsoft Entra ID (Azure AD), Google Workspace, and Auth0 are common IdPs.
The Service Provider (SP) — also called the relying party — is any app the user wants to reach: the wiki, the dashboard, the SaaS tool. The SP does *not* verify credentials. It only knows how to redirect users to the IdP and how to validate the signed response that comes back.
Trust between them is established once, at configuration time, by exchanging cryptographic keys and metadata. The IdP publishes a public key (or certificate); the SP is configured to accept assertions signed by that key. This pre-shared trust is what lets the SP validate an assertion *offline* — by checking the signature — without phoning the IdP on every request. Set up the trust wrong (expired certificate, mismatched entity id, wrong clock) and SSO breaks in confusing ways, which is why most real-world SSO debugging is really trust-configuration debugging.
The flow end to end
Here is what actually happens when a user opens an SSO-protected app for the first time in a browsing session (this is the SP-initiated flow, the most common):
- The user requests a protected page at the SP. The SP finds no local session.
- The SP builds an authentication request and redirects the browser to the IdP, passing along who is asking and where to send the answer.
- The IdP checks whether the user already has a live session with it. If yes, it skips straight ahead; if not, it presents its login page and the user authenticates (password plus any second factor).
- The IdP mints a signed assertion describing the user and posts it, via the browser, back to the SP's agreed callback URL.
- The SP validates the signature against the IdP's public key, checks the assertion is fresh and intended for it, reads the identity out, and creates its own local session (typically a session cookie).
- The user sees the protected page.
The magic moment is the *second* app. When the user opens another SP, it redirects to the same IdP — but now the IdP already has a live session for this user, so it issues a fresh assertion without any prompt. The user experiences an instant, seamless entry. The single login they did earlier is being reused. There's also an IdP-initiated variant where the user starts from a portal of apps at the IdP and clicks through, but the trust and assertion mechanics are the same.
SAML vs OIDC: the two protocols
Two protocols dominate, and they carry the same idea in different envelopes.
SAML 2.0 (Security Assertion Markup Language) is the older, enterprise-heavy standard. Its assertions are XML documents signed with XML Digital Signatures, and they're usually delivered by the browser HTTP-POSTing a form to the SP. SAML is deeply entrenched in corporate and B2B SSO — HR systems, Salesforce, legacy enterprise SaaS. It's powerful but verbose, and the XML signing is fiddly to implement correctly.
OpenID Connect (OIDC) is the modern standard, built as an identity layer on top of OAuth 2.0. Its assertion is a compact JSON ID token — a signed JWT — obtained through OAuth's authorization-code flow. OIDC is JSON- and REST-friendly, works naturally for mobile apps, single-page apps, and consumer "Sign in with Google/Apple/GitHub" buttons, and reuses all the OAuth tooling.
A useful way to hold it: both establish that a trusted IdP has authenticated the user and hand the SP a signed, verifiable statement of that fact. SAML wraps it in XML and grew up in the enterprise; OIDC wraps it in a JWT and grew up on the modern web. New integrations increasingly default to OIDC, but SAML remains everywhere in corporate environments, so any real identity system usually has to speak both.
Why the session at the IdP is everything
The property that makes SSO *feel* like magic — logging in once and gliding into every app — comes down to one session living at the IdP. Each SP maintains its *own* local session after it receives an assertion, but those are downstream. The upstream session at the IdP is the source of truth: as long as it's alive, every redirect to the IdP returns an assertion silently.
This design has powerful consequences. Central policy is trivial — enforce 2FA, conditional access, or device checks once at the IdP and every app inherits it. Offboarding is clean — disable the user at the IdP and, once their app sessions lapse, they're locked out everywhere. Auditing is centralized — one place logs every authentication.
But the same centralization is the main trade-off: the IdP becomes a single point of failure and a high-value target. If the IdP is down, users can't log into anything; if the IdP is breached, an attacker potentially reaches every connected app. That's why IdPs are hardened intensely and why Single Log-Out is subtle — killing the IdP session doesn't automatically end every SP's independent local session, so full logout requires the IdP to notify each SP. In practice SSO is a deliberate bargain: you concentrate authentication so you can secure and manage it well in one place, accepting that this one place must be exceptionally reliable and protected.
The user authenticates once with a central Identity Provider (IdP).
Apps act as Service Providers that trust the IdP instead of storing their own credentials.
SAML and OIDC are the common protocols carrying the signed assertion or token.
The IdP's response is signed, so the app can validate it without contacting the IdP for every request.
A live IdP session means later apps skip the login screen entirely.
Quick quiz
In SSO, who actually verifies the user's credentials?
Why doesn't the user log in again at the second app?
Sessions, cookies, JWT & OAuth 2.0
How a server remembers who you are — and who let you in.
How two-factor authentication works
A password can be stolen. A second, independent factor is much harder to steal too.
How HTTPS works
The TLS handshake that turns a plain TCP connection into a private, verified channel.