Q&A-1Explain OAuth, OIDC, SAML, SSO, and SCIM without conflating them.
Answer
The 90-second answer
These five are not alternatives; they sit at different layers. SSO is an outcome: one login reused across apps. Federation is the trust mechanism that makes cross-domain SSO possible. SAML and OIDC are two protocols that carry authentication across that trust boundary. OAuth is not authentication at all: it delegates API access. SCIM is a separate provisioning protocol that manages the account lifecycle. A real enterprise stack runs all of them: OIDC or SAML for login, OAuth for API calls, SCIM to create and delete the accounts.
OAuth 2.0: delegation, not identity
Authorization code flow with PKCE (RFC 6749 + RFC 7636):
- Client generates a
code_verifier(43–128 chars) and sends its SHA-256 hash ascode_challengeon/authorize. - User authenticates at the authorization server; it redirects back with a single-use code, valid ~30–60s.
- Client POSTs code +
code_verifierto/token; the AS re-hashes and compares, then returns an access token (and usually a refresh token). - Client calls the resource server with
Authorization: Bearer <token>.
Nothing here says who the user is. The access token is for the API, not for the client to read.
OIDC: authentication layered on OAuth
The /token response also carries an ID token: a JWT signed by the AS, usually RS256. The client validates signature against the AS's JWKS from /.well-known/openid-configuration, then iss, aud == its client_id, exp, and the nonce it sent. Only then does it treat the subject as authenticated.
SAML 2.0: the same job in XML
SP-initiated: SP sends an AuthnRequest, IdP authenticates, returns a signed Response containing an Assertion with Subject, Conditions (NotBefore/NotOnOrAfter, typically a 5-minute window), AudienceRestriction, and AttributeStatement. The SP validates the XML-DSig signature, audience and time window, then creates its own session.
SCIM 2.0: lifecycle (RFC 7643/7644)
REST + JSON: POST /Users, PATCH to deactivate, DELETE, filter=userName eq "...". Okta and Entra ID push changes here.
| Carries | Format | Typical use | |
|---|---|---|---|
| OAuth 2.0 | Authorization | JSON | API access |
| OIDC | Authentication | JWT | Web/mobile login |
| SAML 2.0 | Authentication | XML | Enterprise browser SSO |
| SCIM 2.0 | Provisioning | JSON | Account/group lifecycle |
| SSO | Session reuse | — | Outcome, not a protocol |
Trade-offs
Pick OIDC for new builds: JSON, discovery, mobile/SPA, API-friendly. Pick SAML when the IdP only speaks SAML or you're integrating legacy enterprise apps. Many IdPs do both against the same directory, so you can run both.
Failure modes
- Confused deputy: client accepts an access token as proof of identity. Detect by enforcing the ID token
audcheck; never use an access token for auth. - Skipped ID token validation → replay. Reject
alg=noneand unverified signatures. - SAML XML signature wrapping: validate the signature over the specific assertion element, not the whole document.
- SCIM deprovisioning lag: SCIM only removes access if the RP honors it. Detect by reconciling IdP active users against app accounts.
- Global logout: SAML SLO is unreliable and OIDC back-channel logout is spotty; RP sessions outlive the IdP session.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.