Visual RFC.
ALL RFCs / RFC 6749
Read the RFC ↗
RFC 6749 / THE FRAMEWORK

Authorization code grant

04

A short-lived code travels through the browser; tokens come from the token endpoint.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

DIAGRAM§ 4.1 ↗
RFC 6749 · § 4.1EXAMPLE
4 / 4
Authorization code grantA short-lived code travels through the browser; tokens come from the token endpoint. Current state: Use the resulting token at the API..Authorization code grantClient○ ○ ○auth.exampleowner consentauthorizesingle-use codecodeToken endpointredeem codeaccess token
04
Use the resulting token at the API.

The resource server checks its authority.

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
WHAT CHANGED
RFC 6749 § 4.1RFC 9700 § 2.1.1

Public clients MUST use PKCE; confidential clients are RECOMMENDED to use it. Authorization servers MUST support PKCE and prevent downgrade.

Read the updated RFC section ↗
KEY POINT

Redeem a code, then use the token.

  • The client sends response_type=code, client_id, and the relevant redirect and transaction parameters.
  • The code is bound to the client and redirect; it MUST be used only once and expires shortly after issuance.
  • The client authenticates when required and exchanges the code for access and optional refresh tokens.
DETAILS

This chapter shows the original framework. Use the later PKCE and injection protections for current deployments.

Read the RFC section ↗

Diagrams simplify the RFC. Read the linked sections for complete requirements.

Privacy
All chapters in this RFC
  1. Four roles, one delegation
  2. Public and confidential clients
  3. Two endpoints, two channels
  4. Authorization code grant
  5. Implicit grant: historical behavior
  6. Password grant: now prohibited
  7. Client credentials and extension grants
  8. Token responses and failures
  9. Refresh without another prompt
  10. Scope and protected resources
  11. Native apps and security boundaries
RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗