OAuth 2.0
OAuth 2.0 is a framework for giving an application limited access to an HTTP service without sharing the resource owner's password. An authorization server issues access tokens that a client presents to a protected API.
itIdentity, access, and cryptography | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — OAuth 2.0
OAuth 2.0 is the thing that lets you click a "Connect to Google" button and give an app access to just your calendar, without ever typing your Google password into it. It is an authorization framework: a set of rules for how one application gets limited, revocable access to your data on another service.
Before it, the way to let an app read your mail was to hand over your username and password and hope for the best. The app then had everything, indefinitely, and changing your password was the only way to take it back. OAuth replaces that with a token, a short-lived credential that says "this app may read this mailbox and nothing else" and that you can revoke on its own.
The design rests on three ideas. The first is the set of four roles: the resource owner (you), the client (the app), the authorization server (which issues tokens), and the resource server (which holds the data and checks tokens). Keep those four straight and most of the confusion goes away.
The second is the authorization code flow with PKCE, the exchange to use whenever a person is present in a browser. The app sends you to the authorization server, you approve, it returns a short-lived code, and the app swaps that code plus a proof it generated earlier for a token. The code travels through the browser; the token does not.
The third is that an access token is a bearer credential: whoever holds it can use it. So it travels only over TLS, never sits in a URL, and never lands in a log.
Here is the part that catches people out: OAuth does not log anyone in. It answers "may this app do this", not "who is this person". Identity is a separate layer called OpenID Connect, built on top of OAuth. A tutorial that uses plain OAuth for "sign in with..." is leaning on behavior the framework never promised.
The second trap is assuming that a valid token means the request is allowed. The resource server still has to confirm the token was issued for it, has not expired, and carries the right scope, and then that the specific record belongs to the caller. Most OAuth security failures are one of those checks, skipped.
For the full picture of roles, flow, and token handling, read the Introduction, with the Slides as the compressed version. The Cheatsheet has the grant-selection table and an error-to-cause lookup for when something returns invalid_grant. The Practice tab walks through deriving a PKCE challenge by hand, and Field Notes covers what teams get wrong once they are past the diagram.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://datatracker.ietf.org/doc/html/rfc6749
Supports
- OAuth 2.0 purpose, four roles, abstract flow, endpoints, client types, scopes, grants, access tokens, refresh tokens, and errors
- Authorization code and client credentials behavior
- OAuth 2.0 publication in October 2012 and its relationship to OAuth 1.0
- Quiz answers about roles, authorization, client credentials, and refresh tokens
- https://datatracker.ietf.org/doc/html/rfc6750
Supports
- Bearer token definition, HTTP Authorization header use, resource-server errors, and token disclosure threats
- Bearer token publication in October 2012
- Quiz answer about possession-based token use
- https://datatracker.ietf.org/doc/html/rfc7636
Supports
- PKCE verifier, challenge, S256 method, authorization request, token exchange, and code interception defense
- PKCE publication in September 2015
- Quiz answer about code binding
- https://datatracker.ietf.org/doc/html/rfc9700
Supports
- Current recommendations for authorization code flows, PKCE, exact redirect matching, issuer and audience restriction, and sender-constrained tokens
- Prohibition of implicit and resource owner password credentials grants
- Refresh-token rotation and replay response
- Publication in January 2025 and replacement of earlier OAuth security guidance
- Quiz answers about flow selection, audience, and refresh-token reuse
- https://datatracker.ietf.org/doc/html/rfc5849
Supports
- OAuth 1.0 publication in April 2010
- Timeline transition from OAuth 1.0 to OAuth 2.0
- https://datatracker.ietf.org/doc/html/rfc7009
Supports
- Token revocation endpoint behavior and limits
- Token revocation publication in August 2013
- Reference-link rationale
- https://datatracker.ietf.org/doc/html/rfc7662
Supports
- Token introspection requests, active state, response metadata, and protected endpoint behavior
- Token introspection publication in October 2015
- Quiz answer comparing local validation with current token-state lookup
- https://datatracker.ietf.org/doc/html/rfc8252
Supports
- Native applications as public clients, external user agents, redirect choices, and PKCE
- Native-app guidance publication in October 2017
- Reference-link rationale
- https://datatracker.ietf.org/doc/html/rfc8628
Supports
- Device authorization grant roles, device code, user code, verification URI, and polling
- Device grant publication in August 2019
- Flow-selection guidance and reference-link rationale
- https://datatracker.ietf.org/doc/html/rfc8414
Supports
- Authorization server issuer and endpoint metadata
- Reference-link rationale about machine-readable configuration
- https://datatracker.ietf.org/doc/html/rfc9126
Supports
- Pushed authorization request endpoint, request URI, integrity, confidentiality, and size use cases
- PAR publication in September 2021
- Reference-link rationale
- https://datatracker.ietf.org/doc/html/rfc9449
Supports
- DPoP proofs, key binding, sender-constrained access and refresh tokens, and replay limits
- DPoP publication in September 2023
- Quiz answer about proof of key control and reference-link rationale
- https://openid.net/specs/openid-connect-core-1_0.html
Supports
- OpenID Connect as an identity layer on top of OAuth 2.0
- Distinction between OAuth authorization and user authentication
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the curated Identity and Access Management list
- https://github.com/kdeldycke/awesome-iam
Supports
- OAuth and OpenID section identifies Hydra, Keycloak, Casdoor, authentik, ZITADEL, and Obligator as relevant ecosystem projects
- https://www.ory.sh/docs/oauth2-oidc/
Supports
- Hydra's OAuth 2.0 and OpenID Connect endpoints and separation of login and consent applications
- Awesome Links rationale and Landscape placement for Ory Hydra
- https://www.keycloak.org/guides
Supports
- Keycloak deployment, client registration, OpenID Connect application security, token exchange, DPoP, and operational guides
- Awesome Links rationale and Landscape placement for Keycloak
- https://casdoor.org/docs/overview
Supports
- Casdoor OAuth 2.0 support, authorization request, code response, scopes, clients, and token exchange
- Awesome Links rationale
- https://docs.goauthentik.io/add-secure-apps/providers/oauth2/
Supports
- OAuth 2.0 and OpenID Connect provider configuration and application integration
- Awesome Links rationale
- https://zitadel.com/docs/guides/integrate/login/oidc/oauth-recommended-flows
Supports
- Authorization code with PKCE, client credentials, and device authorization guidance
- Awesome Links rationale
- https://github.com/lastlogin-net/obligator
Supports
- Obligator as a compact self-hosted OpenID Connect server
- Awesome Links rationale
- https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce
Supports
- Auth0 authorization code with PKCE endpoints, client registration, and API token issuance
- Landscape placement for Auth0
- https://auth0.com/pricing
Supports
- Auth0 proprietary hosted service with free and paid plans
- Landscape pricing classification
- https://developer.okta.com/docs/concepts/oauth-openid/
Supports
- Okta organization and custom authorization servers, OAuth endpoints, metadata, keys, scopes, and tokens
- Landscape placement for Okta
- https://developer.okta.com/signup/
Supports
- Okta developer account availability alongside commercial service
- Landscape pricing classification
- https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow
Supports
- Microsoft identity platform client registration, redirect URIs, scopes, authorization endpoint, token endpoint, and PKCE
- Landscape placement for Microsoft Entra ID
- https://www.microsoft.com/en-us/security/business/microsoft-entra-pricing
Supports
- Microsoft Entra free and paid service tiers
- Landscape pricing classification
- https://docs.aws.amazon.com/cognito/latest/developerguide/authorization-endpoint.html
Supports
- Cognito authorization endpoint, app clients, callback URLs, scopes, code flow, and PKCE
- Landscape placement for Amazon Cognito
- https://aws.amazon.com/cognito/pricing/
Supports
- Amazon Cognito free allowance and usage-based paid service
- Landscape pricing classification
- https://developers.google.com/identity/protocols/oauth2
Supports
- Google OAuth endpoints, registered applications, flows, scopes, and access tokens for Google APIs
- Landscape placement and free protocol service classification for Google Identity
- https://fusionauth.io/docs/lifecycle/authenticate-users/oauth
Supports
- FusionAuth OAuth endpoints, grants, redirect URIs, scopes, token signing, applications, and tenants
- Landscape placement for FusionAuth
- https://fusionauth.io/pricing
Supports
- FusionAuth free community edition and paid editions
- Landscape licensing and pricing classification
- https://curity.io/product/identity-server/
Supports
- Curity Identity Server as a deployable OAuth and OpenID Connect authorization server for APIs
- Landscape placement and proprietary paid classification
- https://www.pingidentity.com/en/platform/capabilities/oauth.html
Supports
- Ping Identity OAuth authorization-server capabilities for enterprise API access
- Landscape placement and proprietary paid classification
- https://datatracker.ietf.org/doc/html/rfc7636#appendix-B
Supports
- PKCE S256 worked example with the concrete code_verifier and resulting code_challenge test vector
- Practice-reference and exercise verification target for PKCE challenge derivation
- code_verifier length bounds and base64url-without-padding encoding
- https://datatracker.ietf.org/doc/html/rfc8725
Supports
- Algorithm pinning, rejection of attacker-controlled alg, and the RS256-to-HS256 confusion attack
- Mandatory audience validation before accepting a JWT
- Field Notes difficulty card and practice-reference token-validation checks
- https://www.rfc-editor.org/rfc/rfc10017.html
Supports
- Backend-for-frontend as the recommended architecture for browser-based applications
- Tokens reachable by JavaScript are unsafe against malicious scripts or dependencies
- Field Notes shift card on changed SPA guidance
