OAuth 2.0
A framework for delegated authorization: a user lets an application call an API on their behalf without giving it their password.
In more detail
The resource owner approves, the authorization server issues an access token, the client presents it, and the resource server enforces it. OAuth says what a token permits, not who the person is; OpenID Connect adds that. Current guidance favours the authorization code flow with PKCE.
Related terms
- resource owner — In OAuth, the person or system that owns the data and can grant an application access to it.
- authorization server — In OAuth, the service that authenticates the resource owner, asks for consent and issues tokens.
- resource server — In OAuth, the API that holds the protected data and accepts access tokens.
- access token — A generated string that proves who you are to a service, used instead of a password and revocable on its own.
- OpenID Connect — An identity layer on top of OAuth 2.0 that tells an application who signed in, using a signed ID token.
- authorization code flow — The OAuth flow in which the browser brings back a short-lived code that the client then exchanges directly with the authorization server for tokens.
- PKCE — Short for Proof Key for Code Exchange: the client sends a hash of a random secret at the start of the flow and the secret itself when exchanging the code.
Taught in
- Connect An Agent To MCP — AI Engineering: LLM Apps, RAG & Agents
- Remote Servers And Trust — AI Engineering: LLM Apps, RAG & Agents
- Basic Auth, Tokens And Sessions — Modern API Architecture: REST, GraphQL & gRPC
- OAuth Two And OpenID Connect — Modern API Architecture: REST, GraphQL & gRPC
- GitHub Actions And Azure Pipelines Side By Side — Microsoft Azure DevOps Engineer Expert (AZ-400) Exam Prep
- Session Architecture: HTTP-Only Cookies vs Tokens — Production Full-Stack Engineering
- OAuth2 & OpenID Connect: Social Auth & PKCE Flows — Production Full-Stack Engineering
References
- RFC 6749: The OAuth 2.0 Authorization Framework
- RFC 9700: Best Current Practice for OAuth 2.0 Security
- OAuth 2.0 (oauth.net)