Pcornel
Browse topics
Options
Recent
Favorites
Identity · Technical reference

OAuth 2.0

Direct answer

OAuth 2.0 is an authorization framework that lets an application get limited access to an API on a user's behalf through access tokens, without handling the user's password. Use authorization code with PKCE.

When to use this

Use this when apps need delegated API access without user passwords.

First 30 seconds

1. OAuth 2.0 delegates authorization via access tokens.

2. Use authorization code + PKCE.

3. No implicit flow.

4. Exact redirect URI matching.

5. Least-privilege scopes; short-lived tokens.

Operational verification

client → authorize (code + PKCE) → token → API

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Identity, authentication and access control
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformIdentity, authentication and access control
Scope / prerequisiteUse this when apps need delegated API access without user passwords.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Known-good, broken and when it is fixed Verify boundary

Known-good means the intended client obtains a token through the approved flow, the token is constrained to expected issuer/audience/scope/lifetime, the resource server accepts it for an allowed operation and rejects an out-of-scope operation. HTTP success at the token endpoint shows issuance only; protected-resource behavior closes delegated authorization.

Step 2 Native failure isolation and next-check logic Narrow the fault

Identify client ID, grant/flow, requested scopes, redirect URI, token audience/resource and the failing resource request. For authorization failures, distinguish authorization-endpoint errors from token-endpoint errors and resource-server rejection. Inspect token claims/metadata without treating them as authoritative unless signature/issuer/audience validation is performed by the resource server. If a token is valid but access is denied, inspect resource policy and scope-to-permission mapping.

Step 3 Common mistakes Narrow the fault
  • Using OAuth tokens as evidence of identity (use OIDC ID tokens).
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Use authorization code flow with PKCE.
  • Implicit flow is deprecated.
  • Tokens must be scoped minimally.
Key checks
  • curl -s https://<as>/.well-known/oauth-authorization-server — metadata
  • Registered redirect URIs — exact match
  • Granted scopes per client — least privilege
ReferenceWhat it is1 section · depth on demand
ReferenceHow it works1 section · depth on demand

How it works

OAuth 2.0 delegates authorization using clients, authorization server, resource owner context and access tokens scoped to protected resources. Grant/flow selection determines how the client obtains tokens; scopes and audience/resource indicators define intended use. Token issuance shows authorization-server processing, not that a resource server will accept the token for a particular action.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

OAuth 2.0 is an authorisation framework that lets a client application obtain limited access to an API on behalf of a user or itself, via access tokens issued by an authorisation server. It is about delegated authorisation, not authentication (that is OpenID Connect's role).

Grant / flowUse
Authorization code + PKCEWeb, mobile and single-page apps (recommended)
Client credentialsMachine-to-machine
Device authorizationDevices without browsers (CLI tools, TVs)
Refresh tokenRenew access without user interaction
Implicit, passwordDeprecated — do not use

Security essentials: exact redirect URI matching, PKCE for all public clients, minimal scopes, short-lived access tokens, protected client secrets (or certificate/private_key_jwt), and OAuth 2.1 / security BCP guidance.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Security best practice (RFC 9700)

RFC 9700 (January 2025, BCP 240) is the IETF's current security guidance for OAuth 2.0 and updates RFC 6749, 6750 and 6819. The points that change everyday configuration:

RecommendationWhat to do
Authorization code + PKCEPublic clients must use PKCE; confidential clients should. Use S256. Servers must enforce the verifier when a challenge was sent.
No implicit grantDo not return access tokens from the authorization endpoint (response_type=token).
No password grantThe resource owner password credentials grant must not be used.
Exact redirect URIsServers compare redirect URIs by exact string match (only the port of localhost may vary for native apps). No wildcards.
Refresh tokensFor public clients, refresh tokens must be sender-constrained or rotated on every use.
Sender-constrained tokensPrefer mTLS (RFC 8705) or DPoP (RFC 9449) and restrict token audience.

For unattended machine-to-machine access use the client credentials grant with a certificate or private-key JWT rather than a shared secret where the IdP supports it.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docIdentity, authentication and access control current

Authoritative/upstream documentation reviewed for bounded claims in Single Sign-On & Federation → OAuth 2.0. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc7522 · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
oauthoauth2
Confirmation

Confirm action

Continue?