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.

RFC 6749 · § 4.1EXAMPLE
4 / 4
04
Use the resulting token at the API.

The resource server checks its authority.

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 grantClientResource APIAfter the token response: client holds AT1access token AT1 + resource requestAPI checks token validity, expiry and scopeauthorized resourcesCode C1 was already consumed at the token endpoint

Key idea: Redeem a code, then use the token.

Terms

Look up a term in the glossary ↗

Rules & examples
  • 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.

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

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A key is different from permission.

An app, a person, and a server have different roles. Follow who asks, who grants permission, and who checks the credential. A key in the drawing is an analogy, not a literal protocol field.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

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

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 ↗

All chapters in RFC 6749

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

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

RFC status and corrections ↗