Authorization code flow
Also called: authorization code grant, OAuth code flow
The authorization code flow obtains an access token in two stages. After the authorization interaction, the browser returns a short-lived code to the client. The client exchanges that code at the token endpoint, supplying the required checks and credentials, rather than treating the code itself as an API token.
For example, a scheduling app receives a code after calendar access is approved, then exchanges it using PKCE. Public clients must use PKCE under OAuth’s security best practice; confidential clients are also advised to use it. Redirect validation and protection against forged or injected responses remain essential.
- Read first
- OAuth 2.0
- Related
- PKCE, OpenID Connect