Protocols
Saved & recent

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
Further reading
browser and app authorization service browser authorization request browser redirect to app authorization code app → token endpoint code exchange · PKCE checked token response access token separate endpoint exchange
Simplified authorization code flow with PKCE. The browser returns a code; the app then sends code plus verifier to the token endpoint. The access token comes from that separate exchange, after required validation and client authentication where applicable.

View in the full Protocols collection