Authorization code grant
04A short-lived code travels through the browser; tokens come from the token endpoint.
The resource server checks its authority.
Key idea: Redeem a code, then use the token.
Rules & examples
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.
This chapter shows the original framework. Use the later PKCE and injection protections for current deployments.
Sources
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.
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 ↗