Single sign-on (SSO) means a person authenticates once with a trusted identity provider (IdP) and then accesses multiple applications without typing a password again for each one. For engineering teams, SSO is not only a convenience feature. It is the control plane for who can reach internal tools, customer data, and production systems.
When SSO works well, onboarding is faster, password resets drop, and security teams can revoke access in one place. When it is bolted on late, you get fragile cookie hacks, duplicate user directories, and outages every time a vendor rotates certificates.
What problem SSO actually solves
Before SSO, every SaaS tool maintained its own username database. Employees reused passwords, IT could not offboard people cleanly, and phishing against one weak portal often spilled into others.
SSO centralizes authentication. Applications still authorize (decide what a user may do), but they outsource who the user is to an IdP such as Okta, Azure AD (Entra ID), Google Workspace, or Keycloak.
The user experience looks like this:
- You visit
analytics.company.internal. - The app redirects you to the corporate IdP login screen (or uses an existing session).
- After successful login, the IdP sends a signed assertion back to the app.
- The app creates a local session and loads the dashboard.
You repeat step 1 for other apps, but step 3 is often skipped because the IdP session cookie is still valid.
Core protocols you will encounter
SAML 2.0
SAML is XML-based and common in enterprise B2B integrations. The IdP posts a signed SAML assertion to the service provider (SP). SAML shines when you integrate older ERP, HR, or government systems that already speak it.
Tradeoffs: XML payloads are verbose, debugging is painful without good logs, and mobile flows can feel clunky compared with modern OAuth redirects.
OpenID Connect (OIDC)
OIDC sits on OAuth 2.0 and returns ID tokens (usually JWTs) that describe the user. Most developer-first tools—GitHub Enterprise, Slack, many internal SPAs—prefer OIDC because libraries are plentiful and tokens are easy to validate.
A typical authorization code flow with PKCE:
Browser -> App: GET /login
App -> Browser: Redirect to IdP /authorize?client_id=...&code_challenge=...
User authenticates at IdP
IdP -> Browser: Redirect to App /callback?code=...
App -> IdP: POST /token (code + client_secret or PKCE verifier)
IdP -> App: id_token + access_token
App: Validates id_token signature, iss, aud, exp; creates session
LDAP and directory sync (not quite SSO, but related)
Some teams still bind apps directly to LDAP for authentication. That is closer to federated directories than true SSO. Modern designs usually sync users into the IdP (SCIM) and let OIDC/SAML handle login.
Sessions, tokens, and where teams get confused
SSO involves two layers of session:
| Layer | Lifetime | Typical storage |
|---|---|---|
| IdP session | Hours to days | HttpOnly cookie on IdP domain |
| App session | Minutes to hours | App cookie or server-side store |
Confusion appears when engineers treat OIDC access tokens like browser sessions. Access tokens often expire quickly and are meant for API calls. The ID token proves authentication to the app; the app session cookie keeps the user logged in afterward.
Rules of thumb:
- Validate JWT signatures against the IdP JWKS endpoint and cache keys with rotation support.
- Enforce
aud(audience) so another client cannot replay tokens. - Keep refresh tokens server-side when possible; never stash them in localStorage for SPAs unless you accept elevated XSS risk.
Implementing SSO in a typical web stack
Service provider configuration
Whether you use SAML or OIDC, you register each application at the IdP with:
- Redirect URIs (exact match; no wildcards in production)
- Entity ID / client ID
- Certificates or client secrets
- Attribute mapping (email, groups, department)
Group claims matter for authorization. Map IdP groups to app roles during login instead of manually editing roles per user.
Just-in-time (JIT) provisioning
Many internal tools create a user record on first login when SAML/OIDC assertion includes email and groups. This reduces admin busywork but requires guardrails: default role should be least privilege, and disabled IdP accounts must block login immediately.
SCIM complements JIT by pushing user lifecycle events (hire, transfer, termination) so apps do not wait for the next login to learn someone left.
Single logout (SLO)
True global logout—ending every app session when the user signs out of the IdP—is harder than login. Some stacks implement partial SLO; others accept that app sessions expire independently. Document your behavior so security audits do not assume fantasy-all-apps-logout unless you built it.
Security considerations that belong in design reviews
Phishing resistance: Password-based IdP login is still phishingable. WebAuthn/FIDO2 or device compliance policies materially reduce account takeover.
Certificate expiry: SAML integrations break silently when metadata certificates expire. Automate expiry alerts 30+ days ahead.
RelayState and open redirects: Validate RelayState and redirect_uri parameters so attackers cannot craft login links that bounce users to malicious sites.
Multi-tenant SaaS: If you ship a product with SSO for customers, isolate IdP metadata per tenant and never share client secrets across organizations.
Operations and observability
Instrument these metrics from day one:
- Login success vs failure rates (split by error code)
- Token validation failures (clock skew, bad signature, wrong audience)
- Time to first byte after SSO callback
- IdP latency during peak login windows
Run synthetic login checks every few minutes against staging with a dedicated test user. Production SSO outages block entire companies; paging on failed synthetics is cheaper than emergency bridge calls.
Common failure modes in production
- Clock skew – JWT
nbf/expvalidation fails when servers drift. Use NTP everywhere. - Attribute mismatch – IdP sends
mailbut app expectsemail. Standardize mapping tables. - Stale metadata – IdP rotated signing cert; SP still trusts old one. Automate metadata pulls.
- Infinite redirect loops – Misconfigured ACS URL or cookie
SameSiteafter browser upgrades. - Session fixation – App session ID not regenerated after SSO success. Rotate session identifiers post-login.
Choosing an approach for greenfield apps
For new internal SPAs and APIs on AWS or GCP:
- Prefer OIDC with authorization code + PKCE for user login.
- Store API tokens in HttpOnly cookies via a backend-for-frontend (BFF) if you need long-lived access to microservices.
- Use the IdP's group claims and keep authorization logic in your app or a policy engine (OPA, Cedar, etc.).
Keep SAML adapters for the one legacy vendor that requires it, but do not let SAML dictate your entire identity architecture.
FAQ
Is SSO the same as social login?
Social login (Sign in with Google) is a form of federated SSO where Google acts as the IdP. Enterprise SSO adds contracts, SLAs, group provisioning, and compliance requirements social login alone does not cover.
Does SSO remove the need for MFA?
No. MFA should live at the IdP. Apps trust the IdP's authentication strength via authentication context claims when needed.
Can machine-to-machine workloads use SSO?
Interactive SSO targets humans. Services should use OAuth client credentials, IAM roles, or workload identity—not browser redirects.
How long should IdP sessions last?
Balance security with help desk load. Many organizations use 8–24 hours for corporate laptops with device compliance, shorter for highly sensitive admin consoles.
Single sign-on is less about eliminating passwords entirely and more about centralizing trust so every application does not become its own identity island. Nail protocol choice, token validation, and lifecycle sync early, and SSO becomes a reliability feature—not a recurring outage source.
Further Reading
Discover more articles on similar topics across our network

Comments
Loading comments…