OAuth Reference
|
This section documents OAuth 2.0 (RFC 6749) as amended by the OAuth 2.0 Security Best Current Practice (RFC 9700 / BCP 240), the OAuth 1.0 Protocol (RFC 5849) for historical context, and OpenID Connect Core 1.0, as published at the IETF Datatracker and the OpenID Foundation specifications — and, on the Spring pages, Spring Boot 4.1.x and Spring Security 7.1.x as published at the Spring Security reference documentation — which are the references these pages are written and verified against. OAuth 2.1 is still an Internet-Draft ( This content was generated with the assistance of AI and should be verified against those official specifications before being relied on in production. This section’s bibliography lists the reference material consulted while preparing these pages. |
Welcome to the OAuth reference. OAuth is a delegated authorization framework: it lets a user grant an application limited access to their data on another service, without ever handing that application their password. It is not an authentication protocol on its own — that is what OpenID Connect adds on top of it, and confusing the two is the most common and most expensive mistake in this area.
This section is protocol-first. It documents what the specifications actually say — OAuth 1.0a (RFC 5849), OAuth 2.0 (RFC 6749) as amended by the Security Best Current Practice (RFC 9700), the in-progress OAuth 2.1 consolidation, OpenID Connect Core 1.0, and the surrounding extension RFCs — with real HTTP requests and responses rather than library calls. Only the last three pages map all of that onto Spring Boot.
If you are new to OAuth, read Getting Started with OAuth first, then Choosing an OAuth Flow, Authorization Code and PKCE and Access and Refresh Tokens. Everything after that builds on those foundations.
For the Spring Boot services this protocol secures, see the sibling SpringBoot Reference — in particular Spring Security and Authorization Server & Social Login, which this section links to rather than duplicating. For securing a GraphQL surface, see GraphQL Authorization.
What’s covered
Foundations
-
Getting Started with OAuth — the problem OAuth solves, the four roles, confidential vs. public clients, the endpoints, and a complete authorization-code round-trip.
-
How OAuth Evolved — from the proprietary pre-OAuth protocols through OAuth 1.0, 1.0a and WRAP to RFC 6749, the extension decade, and the OAuth 2.1 draft.
-
OAuth 1.0a — the three-legged dance, the signature base string, the signature methods, and where it still survives.
-
OAuth 1.0 vs. OAuth 2.0 — each 1.0 limitation and what 2.0 did about it, plus an honest account of what 2.0 gave up in exchange.
Tokens
-
Access and Refresh Tokens — bearer vs. sender-constrained, by-value vs. by-reference, the token response, and refresh-token rotation and reuse detection.
-
ID Tokens vs. Access Tokens — what each one is for, why swapping them is broken, and a comparison of all three token types.
-
JWT and the JOSE Family — JWS, JWE, JWK and JWA, the claim set, algorithm choice, the classic attacks, JWKS and key rotation, and a resource-server validation checklist.
-
Opaque Tokens, Introspection and Revocation — introspection, revocation, token status lists, and choosing between JWT and opaque tokens.
-
Scopes, Claims and Permissions — scopes vs. claims vs. roles, resource indicators, Rich Authorization Requests, step-up, and where the decision belongs.
Flows
-
Choosing an OAuth Flow — a decision tree by client shape, and every grant type with its current status.
-
Authorization Code and PKCE — every parameter, the
issresponse parameter, and whatstate,nonceand PKCE each actually protect. -
Client Credentials and Client Authentication — machine-to-machine, and every client-authentication method side by side.
-
Device Authorization Grant — input-constrained devices, the polling loop, and the cross-device phishing threat.
-
Token Exchange and Assertion Grants — impersonation vs. delegation, the JWT and SAML bearer grants, and identity chaining.
-
Legacy Grants: Implicit and Password — how they worked, exactly why both are gone, and what to migrate to.
App types
-
Native and Mobile Apps — why embedded WebViews are forbidden, in-app browser tabs, the three redirect-URI options, and what a real browser buys you.
-
Browser-Based Apps (SPAs) — the browser threat model, the backend-for-frontend pattern, and the browser-only variant with its residual risks.
Security
-
Security Best Practices — the Security BCP as a threat-by-threat checklist, including mix-up attacks, code injection and token leakage.
-
Sender-Constrained Tokens: DPoP and mTLS — binding a token to a key so a leaked token is useless, and how proof of possession came back.
-
PAR, JAR and Hardened Profiles — pushed and signed authorization requests, and the FAPI profiles that mandate them.
OpenID Connect and identity
-
OpenID Connect — the ID token,
nonce, standard claims, UserInfo, and the authentication signals a client can request and verify. -
Discovery, Metadata and Client Registration — the well-known documents, protected resource metadata, and dynamic client registration.
-
Logout and Session Management — RP-initiated, front-channel and back-channel logout, and single logout in a microservice topology.
-
Social Login and Federation — account linking and the verified-e-mail trap, provider quirks, SAML vs. OIDC, and the broker pattern.
-
Authentication Methods: Passwordless and 2FA — the passwordless primary methods, 2FA as an additional layer stacked on them, and how the result reaches the client through
acr,amrandauth_time.
Operating
-
Testing and Debugging OAuth — running each flow by hand, what the standard error codes really mean, and conformance testing.
Spring Boot integration
-
Spring Boot Integration: Overview — the three roles a Spring service can play, a protocol-concept to Spring-type dictionary, and what is already documented elsewhere in this repository.
-
Spring Boot Flow Recipes — one minimal recipe per grant type, including the ones the SpringBoot reference does not already cover.
-
Spring Boot Authentication Methods — one-time token login, passkeys, multi-factor authentication, what Spring does not implement, and emitting
amr/acr/auth_time.
Reference
-
OAuth Cheat Sheet — a one-page, printable summary of the whole section, with a downloadable PDF.
Bibliography
-
IETF OAuth specifications (primary source for every protocol page) — RFC 6749 (The OAuth 2.0 Authorization Framework), RFC 6750 (Bearer Token Usage), RFC 5849 (The OAuth 1.0 Protocol), RFC 6819 (Threat Model), RFC 7009 (Token Revocation), RFC 7515 (JWS), RFC 7516 (JWE), RFC 7517 (JWK), RFC 7518 (JWA), RFC 7519 (JWT), RFC 7521, RFC 7522 and RFC 7523 (assertion framework and the SAML/JWT profiles), RFC 7591 and RFC 7592 (dynamic client registration and management), RFC 7636 (PKCE), RFC 7662 (Token Introspection), RFC 7800 (proof-of-possession semantics), RFC 8176 (
amrvalues), RFC 8252 (OAuth 2.0 for Native Apps), RFC 8414 (Authorization Server Metadata), RFC 8628 (Device Authorization Grant), RFC 8693 (Token Exchange), RFC 8705 (Mutual-TLS), RFC 8707 (Resource Indicators), RFC 8725 (JWT Best Current Practices), RFC 9068 (JWT Profile for Access Tokens), RFC 9101 (JAR), RFC 9126 (PAR), RFC 9207 (Issuer Identification), RFC 9396 (Rich Authorization Requests), RFC 9449 (DPoP), RFC 9470 (Step Up Authentication Challenge), RFC 9700 (Security Best Current Practice), RFC 9701 (JWT Response for Token Introspection), RFC 9728 (Protected Resource Metadata), RFC 9901 (SD-JWT), RFC 10017 (OAuth 2.0 for Browser-Based Applications) and RFC 10027 (Security of Cross-Device Flows); the in-progress OAuth 2.1 draft; and the working group’s own document index at datatracker.ietf.org and oauth.net/specs. -
OpenID Foundation specifications (primary source for the OpenID Connect pages) — Core 1.0, Discovery 1.0, Dynamic Client Registration 1.0, RP-Initiated Logout 1.0, Front-Channel Logout 1.0, Back-Channel Logout 1.0, Session Management 1.0, CIBA Core 1.0, Native SSO for Mobile Apps 1.0, FAPI 2.0 Security Profile, FAPI 1.0 Baseline and FAPI 1.0 Advanced, plus the OpenID certification programme and the specification index at openid.net.
-
Authentication-factor standards — RFC 6238 (TOTP) and RFC 4226 (HOTP); W3C Web Authentication (WebAuthn) Level 3; the FIDO Alliance specifications; and NIST SP 800-63B (Digital Identity Guidelines — Authentication and Lifecycle Management), the source of the authenticator-assurance levels and of the restriction on SMS as an authenticator.
-
Framework documentation (primary source for the Spring pages) — the Spring Security reference (OAuth2 login, client and resource server, the authorization server, one-time token login, passkeys and multi-factor authentication), the Spring Authorization Server reference, Spring Boot’s Spring Security support, and the Spring blog post Multi-Factor Authentication in Spring Security 7.
-
Provider documentation cited on the social-login page — Google Identity — OpenID Connect, Microsoft Entra — OpenID Connect, Apple — Sign in with Apple REST API and GitHub — Authorizing OAuth apps.
-
Consulted reference book (bibliography only — not the primary or main source for any page) — Boyd, Ryan. Getting Started with OAuth 2.0. O’Reilly Media, 2012. ISBN 978-1-449-31160-5 — publisher page. Published eight months before RFC 6749 and written against the OAuth 2.0 draft, it predates PKCE, discovery, refresh-token rotation, the
issresponse parameter and the entire Security BCP; it recommends the implicit and resource-owner-password grants, treats embedded WebViews as acceptable on mobile, and describes a draft "check ID endpoint" that never shipped in OpenID Connect Core 1.0. It informs only the historical narrative on How OAuth Evolved and OAuth 1.0 vs. OAuth 2.0, and the role and terminology framing on Getting Started with OAuth.
The book above is a consulted reference only. It is not the primary reference for any page, and wherever it and the specifications disagree — or wherever it is silent on something standardised after 2012 — the IETF RFCs and the OpenID Connect specifications are authoritative.