Sign-in and federation
How people sign in, how one sign-in carries across applications, how applications act for people with OAuth 2.0 and OpenID Connect, and how sessions and tokens are given lifetimes.
Start with Methods, credentials, and factors
Authentication methods and MFA
Passwords, codes, passkeys and security keys, what makes sign-in multi-factor, authenticator assurance levels, how to design recovery, and how authentication policy works.
- Methods, credentials, and factorsDistinguish account identifiers, credentials, authenticators, and factors by following the evidence in a sign-in.
- Passwords and PINsFollow password verification, understand reuse, phishing, and current guidance on password rules, and distinguish a remote password from a local authenticator PIN.
- Codes, links, and approval promptsCompare SMS, email links, authenticator codes, and push approvals, including expiration, replay, number matching, and phishing relay.
- Security keys, passkeys, and biometricsUnderstand public-key sign-in, discoverable credentials, local user verification, phishing resistance, and the differences between synced and device-bound passkeys.
- What makes authentication multi-factor?Compare authentication evidence, distinguish passwordless sign-in from MFA, and try a simulated authentication-policy decision.
- Authenticator assurance levelsUse the NIST SP 800-63B-4 assurance levels to match authenticators to risk: AAL1 to AAL3, phishing resistance, restricted and syncable authenticators, and reauthentication limits.
- Enrollment, replacement, and recoveryFollow an authenticator from enrollment through backup, loss, recovery, replacement, and revocation.
- Designing account recoveryDesign recovery as the authentication path it is: the NIST SP 800-63B-4 recovery methods and requirements, recovery codes, help desk verification, proofing, notification and cool-off, and recovery with passkeys.
- Authentication policy and SSOConnect permitted methods, fresh authentication, step-up, and recovery policy to identity providers and application sessions.
- The registration ceremonyRead real creation options, clientDataJSON, authenticator data flags and the attestation object, and see what a server checks before it stores a passkey.
- The authentication ceremonyRead request options and an assertion, check it as a server does, and understand presence, verification and signature counters.
- Attestation and authenticator modelsAsk for attestation, read a packed statement, check authenticator models against the FIDO Metadata Service, and weigh what to require against privacy.
- Synced passkeys, cross-device sign-in, and recoverySee what syncing changes for recovery, read the backup flags, follow a hybrid sign-in from a phone, and roll passkeys out with related origins, conditional mediation, conditional create and the Signal API.
OAuth 2.0
Delegated access with OAuth 2.0, from the problem it solves through the authorization code flow, tokens, client types and production operations.
- The problem OAuth solvesReturn to the photo-printing example to see why sharing a password fails, how access tokens help, and where OAuth and OpenID Connect differ.
- Roles and endpointsSee which decisions belong to each of the four OAuth roles, and follow the responsibilities of the authorization endpoint, client redirect URI, token endpoint, and photo API.
- Trust boundariesExplore what clients, authorization servers, and resource servers must check before trusting OAuth messages and allowing access.
- Grants, scopes, and consentDistinguish OAuth grants, scopes, and consent, and learn how requested access relates to what a service actually permits.
- Public and confidential clientsLearn how a client deployment affects credential protection, why client IDs are not secrets, and how PKCE protects an authorization code exchange.
- Why use the authorization code flow?See how URLs leak through history, logs, the Referer header and shared links, why the code flow returns only a code through the browser, and follow one connection from registration to the first API call.
- The authorization requestRead an OAuth authorization request and understand client IDs, redirect URIs, scopes, state, and PKCE challenges.
- Redirects and authorization codesUnderstand exact redirect URI matching, authorization responses, and safe handling of short-lived authorization codes.
- Proof Key for Code Exchange (PKCE)Follow the PKCE verifier and challenge calculation, and see how binding code redemption to one attempt also stops code injection against confidential clients.
- Correlating requests and responsesConnect OAuth responses to their initiating session, pending transaction, and expected authorization server, and see how those checks stop CSRF and mix-up attacks.
- Exchanging a code for tokensRead an authorization code token request and response, including client authentication, PKCE, and access token use.
- Errors and denied accessDistinguish OAuth authorization denial, token endpoint rejection, and uncertain network outcomes.
- The refresh token grantUnderstand how refresh tokens extend an existing authorization, how rotation replaces them, and what a client does when refresh fails.
- Client credentialsLearn how a confidential client obtains an access token as itself, with no user involved, and why that access should stay narrow.
- Device authorizationFollow the device authorization grant for a photo frame, from user codes and polling to phishing risks with codes someone else started.
- JWT and SAML assertion grantsSee how a client exchanges a signed JWT or SAML assertion for an access token, and what the authorization server must check first.
- Choosing a flowChoose between OAuth grants by asking whose access it is, how a person can authorize it, and whether access must continue.
- Client IDs and registrationLearn what a client registration records, why a client ID is an identifier rather than a credential, and when one application needs several clients.
- Redirect URIs and client metadataRegister return addresses for web, mobile, and desktop clients, and see why client names and logos are claims while technical settings limit requests.
- Client authentication methodsCompare the ways a confidential client proves itself at the token endpoint, from client secrets to signed JWTs and certificates, and handle invalid_client.
- Secrets and signed assertionsFollow a client secret and a private_key_jwt client assertion through a token request, and see what the server checks and why the private key never travels.
- Rotating client credentialsReplace client secrets and keys without downtime by overlapping old and new credentials, and respond when a client credential has leaked.
- Using access tokensSend an access token the way APIs expect, treat it as opaque, replace it before it expires, read WWW-Authenticate errors, and keep it away from other hosts.
- Token formats and validationCompare reference tokens with self-contained JWT access tokens, read the JWT access token profile, and follow the photo API through its validation checks and a key rotation.
- Scopes and audiencesSee why a token names both what it allows and which API may accept it, how the audience is chosen, and how to design scopes that stay useful.
- Enforcing access at an APIFollow an API from a validated token to a decision: map routes to scopes, check each object against the user, and choose between 401, 403, and 404.
- Refresh tokens and rotationSee what an authorization server stores for refresh tokens, how idle and absolute lifetimes work together, how to rotate atomically, and which events should end a token family.
- Token introspectionFollow an API as it asks the authorization server about a token, reads active and inactive answers, caches them safely, and fails closed when no answer comes.
- Token revocationRevoke a refresh token when a person disconnects, see what revocation can and cannot reach, and compare a client revoking its tokens with a person removing the connection.
- Server-rendered web applicationsSee why a website backend makes a strong OAuth client: tokens stay encrypted on the server, sessions and connections end separately, and background jobs refresh safely.
- Browser applicationsRun the authorization code flow in JavaScript as a public client, and see what cross-origin requests, token storage, refresh rules, and injected script mean for it.
- Backends for frontendsMove a browser application's tokens to a small backend, compare three designs, and protect the backend's cookie-based endpoints against cross-site request forgery.
- Native applicationsLearn why mobile and desktop apps sign in through the system browser, redeem codes as public clients with PKCE, and keep refresh tokens in platform secure storage.
- Command-line toolsCompare ways a command-line tool can obtain access, from a loopback redirect to personal access tokens, and keep its tokens out of logs, arguments, and history.
- Service-to-service accessDecide how one API calls another on a user's behalf, why forwarding tokens and trusting headers fail, and how services prove their own identity without long-lived secrets.
- Redirect URI validationFollow an attacker who bends a redirect URI to collect authorization codes, see how careless matching fails, and learn what the server and client each check.
- Request correlation and CSRFSee how a forged callback can link your account to an attacker's photos, which session-bound checks stop it, and how SameSite cookies affect the return trip.
- Code interception and injectionFollow a stolen authorization code through interception and injection, see why client authentication cannot stop injection while PKCE can, and handle a reused code.
- Authorization server mix-upWalk through a mix-up attack in which a compromised authorization server tricks a client into handing over another server's code, and compare the defenses.
- Token theft and replayTrace where access tokens leak, what a replayed bearer token allows and for how long, and how lifetimes, audiences, and sender-constrained tokens limit the damage.
- Refresh token theftSee why refresh tokens attract thieves, how client authentication and rotation block or reveal their use, where rotation leaves a gap, and how to contain a theft.
- OAuth security best practicesReview the OAuth 2.0 Security Best Current Practice role by role, learn the few protections not covered elsewhere, and see how OAuth 2.1 consolidates them.
- Implementing a clientStructure an OAuth client around a maintained library, configure it from metadata, give each job one home in the code, and keep environments and secrets apart.
- Authorization server responsibilitiesSee what running an authorization server involves, from reviewing clients and recording approvals to protecting signing keys, auditing, limiting abuse, and ending grants.
- Resource server responsibilitiesKeep an API that accepts tokens correct over time: trusted issuers per environment, key rollover, clocks, caches, scope changes, rejection monitoring, and outages.
- Tracing and troubleshooting exchangesFollow one connection attempt across browser redirects and back-channel calls, recognize common OAuth failures, and investigate them without leaking codes or tokens.
- Testing an OAuth integrationTest token validation with crafted tokens, client checks with deliberately wrong callbacks, refresh concurrency with a fake server, and the whole flow with test clients.
- Operating and monitoring an integrationDecide which OAuth failures to retry, choose the signals worth monitoring, behave sensibly during an authorization server outage, and prepare for incidents and log retention.
- From OAuth 1.0 to OAuth 2.0Trace OAuth from its 2007 community specification and signed requests, through the 2009 session fixation fix, to OAuth 2.0, bearer tokens, and separate authorization servers.
- The implicit grantSee how the implicit grant returned access tokens in the URL fragment, why browser applications once needed it, what went wrong, and what current guidance says.
- The password grantUnderstand how the password grant exchanged a username and password for tokens, why OAuth 2.0 included it, and why current security guidance forbids it.
- Migrating older integrationsMove an authorization server and its clients away from legacy patterns by taking inventory, choosing replacements, tightening settings, and enforcing each change gradually.
- How the specifications evolveLearn how OAuth documents move from Internet-Draft to RFC, where registries and the OpenID Foundation fit, what OAuth 2.1 consolidates, and how to read MUST and SHOULD.
OpenID Connect (OIDC)
Signing people in with OpenID Connect: ID tokens and their validation, discovery, claims, sessions, logout and implementation.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Sessions, tokens, and lifetimes
How application sessions, provider sessions, access tokens and refresh tokens depend on each other, and how to choose their lifetimes.
- Designing session and token lifetimesSet application sessions, provider sessions, access tokens and refresh tokens on purpose: idle and absolute timeouts, how the layers depend on each other, the revocation gap, step-up windows, device-bound sessions and choosing values.
SAML SAML 2.0
How SAML sign-in works, its bindings, reading an assertion, metadata and key rollover, XML signature wrapping, validating a response, NameID and attributes, logout, and running SAML beside OpenID Connect.
- How SAML sign-in worksFollow a SAML sign-in between an identity provider, a service provider and the browser, from the AuthnRequest to the service's own session.
- SAML bindingsRead an AuthnRequest, a signed HTTP-Redirect query string and an auto-posted HTTP-POST form, and see when Artifact and SOAP use the back channel.
- Reading an assertionRead a complete signed response: issuer, NameID, bearer subject confirmation, conditions, authentication context, attributes and encrypted assertions.
- Metadata, certificates, and key rolloverRead identity provider and service provider metadata, give it a trust path, and roll over each side's keys in the right order.
- SP-initiated and IdP-initiated sign-inTie a solicited response to its request and browser, and understand the login CSRF and replay risks of unsolicited responses.
- XML signatures and wrapping attacksFollow an enveloped XML signature through verification, and see how signature wrapping, comment truncation and weak algorithms defeat careless service providers.
- Validating a responseValidate a SAML response in order, from what the signature covers to status, recipient, times, audience, request and replay, before creating a session.
- NameID and attributesUse pairwise persistent NameIDs, request a format with NameIDPolicy, handle InvalidNameIDPolicy, and keep attributes separate from identity.
- Single logoutFollow a LogoutRequest through the identity provider to the other participants, and report an incomplete result honestly with PartialLogout.
- Running SAML beside OpenID ConnectCompare SAML and OpenID Connect field by field, link accounts across both without matching email addresses, use a broker, and retire the old path safely.