OpenID Connect (OIDC)
Signing people in with OpenID Connect: ID tokens and their validation, discovery, claims, sessions, logout and implementation.
Start with From delegated access to sign-in
Foundations
How OpenID Connect adds sign-in to OAuth, and the providers, relying parties and ID tokens involved.
- From delegated access to sign-inSee why an OAuth access token cannot safely sign someone in to an application, and how OpenID Connect adds an ID token addressed to the application itself.
- Providers and relying partiesMeet the OpenID Provider and the relying party, learn why the issuer identifier anchors trust, and separate what the provider decides from what the application decides.
- ID tokens and access tokensRead a decoded ID token claim by claim, and learn why ID tokens and access tokens have different audiences and must never be used in place of each other.
The sign-in exchange
The OpenID Connect sign-in exchange from the authentication request to the returned ID token.
- Following a complete sign-inFollow an OpenID Connect sign-in from the Continue button to the application's own session, and see which steps reuse the authorization code flow and which are new.
- The authentication requestRead an OpenID Connect authentication request, learn what the openid scope changes, and meet the optional parameters that shape how a provider signs someone in.
- State and nonceUnderstand why a sign-in uses both state and nonce, how a nonce ties an ID token to one attempt, and how it works alongside PKCE.
- Receiving the ID tokenExchange the code, read the token response and the compact ID token, and see why decoding an ID token is not the same as trusting it.
- Authentication errorsHandle OpenID Connect error responses such as login_required and consent_required, and see why a sign-in without a valid ID token must fail.
Validation and trust
Every check an application makes before it trusts an ID token, and how signing keys are found and rotated.
- Validating an ID tokenWork through every check a relying party makes before trusting an ID token, in order, and see how it differs from validating a JWT access token at an API.
- Issuer, audience, and authorized partyCompare the issuer exactly, require the client ID in the audience, reject tokens meant for other clients or shared with untrusted ones, and decide what azp means.
- Expiration and nonce checksCheck exp, iat, and nbf with a small clock tolerance, tell authentication time apart from issue time, and match the nonce to one pending sign-in exactly once.
- Signing keys and rotationFind the provider's signing key in a trusted key set, accept only the algorithms registered for the client, and keep sign-ins working through planned and emergency key changes.
- When validation failsTell configuration mistakes, clock drift, key set outages, and attacks apart, show people a safe message, log what diagnoses the fault, and avoid fixes that remove protection.
Discovery and client configuration
Provider metadata, client registration and the configuration an application needs before its first sign-in.
- Provider discoveryFind an OpenID Provider's configuration from its issuer, check that the document names that same issuer, and keep trust anchored to providers the relying party chose.
- Reading provider metadataRead an OpenID Provider's configuration entry by entry, separate its endpoints from its advertised capabilities, and use metadata without letting it weaken the relying party's own rules.
- Registering a relying partySee what OpenID Connect adds to a client registration, from the ID token signing algorithm and subject type to authentication defaults and logout addresses.
- Supporting several providersAdd a second OpenID Provider without mixing them up: separate configuration, an expected issuer for every attempt, checks at the callback, and subjects scoped by issuer.
Identity, claims, and UserInfo
Standard and custom claims, scopes for claims, UserInfo, and stable and privacy-preserving subject identifiers.
- Standard and custom claimsRead the standard claims OpenID Connect defines for describing a person, see why each is the provider's statement, and name custom claims so they cannot collide.
- Scopes and the claims parameterSee which claims the profile, email, address, and phone scopes request, ask for individual claims with the claims parameter, and handle claims that never arrive.
- The UserInfo endpointCall the UserInfo endpoint with the sign-in's access token, check that the response describes the same subject as the ID token, and decide when calling it is worthwhile.
- Public and pairwise subject identifiersCompare public and pairwise subject identifiers, see how pairwise values stop relying parties from correlating people, and keep subjects stable with sector identifiers.
- Claim stability and privacyLearn which claims can change or be reassigned, what email_verified does and does not prove, and how a relying party collects, refreshes, and protects as little as it needs.
Application accounts and sessions
Turning a verified sign-in into an application account and session, linking accounts and social providers safely, and offline access.
- Connecting a sign-in to an accountTurn a validated OpenID Connect sign-in into a local account by storing the issuer and subject pair, handling a first sign-in safely, and keeping profile claims as copies.
- Linking accountsLink a provider sign-in to an existing account by proving control of both sides, and see why a matching or even verified email address can hand an account to someone else.
- Adding social sign-inAdd a provider button to the collage app's sign-in page and set its own rules: whether a first sign-in may create an account, how far the provider's sign-in counts, and how to plan for outages and retirement.
- Which provider facts to trustTreat the mapping from provider claims to account fields as configuration: give each claim one job, keep every mapping away from authority, decide when it runs, and change it safely.
- Establishing an application sessionStart the relying party's own session after an OpenID Connect sign-in, keep it separate from the provider's session and the ID token, and record what later decisions need.
- Offline access and refresh behaviorRequest offline access with prompt=consent, check the ID token a refresh can return, and see why a successful refresh never shows that someone is present or extends a session.
Controlling authentication
How an application asks for a fresh, stronger or particular kind of sign-in, and what it receives back.
- Prompt and account selectionUse the prompt parameter to check silently for a provider session, ask for a fresh sign-in or consent, or let someone choose between accounts, and handle each answer.
- Login hintsSuggest which account a sign-in is for with login_hint or an earlier ID token, and see why a hint saves typing but never proves who signed in.
- Session age and reauthenticationAsk the provider for a recent sign-in with max_age or prompt=login before a sensitive change, then check auth_time yourself instead of trusting that the request was honored.
- Authentication context and methodsRead the acr and amr claims, request an authentication context with acr_values or an essential claim, and see why the agreed meaning matters more than the method list.
- Requesting stronger authenticationFollow the collage app as it sends Ava back for a passkey sign-in before she downloads a board's originals, checks the result, and handles a provider that cannot comply.
Logout and session coordination
Ending sessions at the application and the provider, and keeping several applications in step.
- Local logout and provider sessionsSee what a sign-out actually ends: the application's own session, the identity provider's session left in the browser, and the other applications single sign-on connected.
- RP-initiated logoutFollow a relying party's request to end the provider's session too, from the end session endpoint and ID token hint to the registered post-logout return address.
- Front-channel logout and browser session checksLearn the two browser logout signals, front-channel logout through hidden frames and Session Management's check session frame, what each page must do, and why third-party cookie and storage partitioning defeat both.
- Back-channel logoutFollow a signed logout token from the provider to each application's server, validate it like an ID token, end the matching sessions, and handle failed deliveries.
Implementation, testing, and migration
Building relying parties for web, single-page and native apps, what a provider must do, response types and modes, conformance testing, diagnosing sign-in failures, how browser privacy changes affect federation, and moving to a new identity provider.
- Implementing a relying partyBring the relying party duties from the whole series into one implementation: choosing a library, holding configuration, handling each step in order, the attacks each check stops, and leaving room to test.
- OpenID Connect in single-page and native appsFollow sign-in into a browser editor and a phone app: where the ID token is validated, why it is never sent to an API, how the response returns to the right app, and what signing out of an app ends.
- How browser privacy changes affect federationSee why blocked and partitioned third-party cookies break silent sign-in in frames and browser logout signals, what the Storage Access API, FedCM and bounce tracking mitigations change, and what a relying party should do instead.
- OpenID Provider responsibilitiesSee what an OpenID Provider must get right for relying parties to trust its ID tokens: issuer and keys, authentication and claim release, stable subjects, metadata, logout, and monitoring.
- Response types, response modes, and older flowsLearn how response_type selects the code, implicit, or hybrid flow and response_mode carries the answer back, check c_hash and at_hash in older integrations, and move them to the code flow with PKCE.
- Conformance testingSee how the OpenID Foundation conformance suite tests providers and relying parties, what its certification profiles cover, and what a passing result does and does not prove.
- Diagnosing sign-in failuresWork from a symptom to the stage that failed and its likely cause, using safe evidence, for failures from redirect mismatches and clock drift to sign-in loops.
- Migrating an identity providerMove to a new identity provider without breaking accounts: importing password hashes, lazy migration, keeping subjects and the issuer, running both side by side, cutover, rollback and telling people.