

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Authentication
incomplete
2: Stateless vs. Stateful Authentication
incomplete
3: What Are Sessions?
incomplete
4: What Are Cookies?
incomplete
5: Cookie Security
incomplete
6: Session Lifetime
incomplete
7: Password Resets
incomplete
8: Broken Password Reset Flow
incomplete
9: OAuth 2.0
incomplete
10: SAML and OIDC
incomplete
11: API Keys
incomplete
12: Reauthentication
incomplete
13: Authentication Misconceptions
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Enterprise systems often need single sign-on (SSO): a way for users to authenticate with one identity provider, and then access multiple applications.
SAML 2.0 and OpenID Connect (OIDC) support SSO through federated identity. Your app relies on an identity provider (IdP) to authenticate the user, then validates a protocol message from that IdP.
SAML is widely used for legacy enterprise SSO. It uses XML documents called assertions to tell your app, the service provider, what the IdP verified about the user.
OIDC is an identity layer built on OAuth 2.0. Its ID tokens are JWTs, and the protocol fits naturally into web, mobile, and API architectures that already use OAuth.
Both can solve the same SSO problem, but their message formats, flows, and validation rules are different.
SAML flow:
OIDC flow:
state, nonce, and a PKCE challenge, then redirects the user to the IdP.nonce, before creating a local session.The important detail is that your app should not ask for the user's password. The IdP handles authentication; your app validates the result. For an OIDC ID token, that includes its signature, issuer, audience, expiration, and nonce when one was sent. Don't trust identity claims until the protocol response passes every required check!
Don't implement SAML or OIDC from scratch! Use a mature protocol library or a trusted identity product, then configure and validate it according to the provider and protocol documentation.