Start with Identity
← Glossary
Protocol

Authorization Code Flow

The recommended OAuth 2.0 flow for apps with a user: the app receives a short-lived code, then exchanges it for tokens from a back channel. Combined with PKCE for public clients.

This is the flow to use for anything with a human in it. The code is useless without the exchange, and the exchange happens over a channel the browser never sees, which is what keeps tokens out of URLs, browser history, and referrer headers. Implicit flow, which returned tokens directly in the redirect, is deprecated in OAuth 2.1 precisely because it lacked that separation. Public clients add PKCE so an intercepted code cannot be redeemed by anyone else.

See also: OAuth 2.0, OAuth 2.1, PKCE, OIDC authorization code with PKCE recipe

Related terms
Last reviewed By SWI Community TeamSuggest a correctionHow we research