LOGBOOK

HELP

Quiz Entry - updated: 2026.10.22

How does the OAuth authorization code flow work, step by step?

The user agent gets an authorization code via the front channel after the user authenticates; the client then exchanges that code, together with its own credentials, for an access token (and optionally a refresh token) via the back channel.

Authorization code flow: front channel steps through the user agent deliver the code, back channel steps between client and authorization server exchange it for tokens

* Only the short-lived code passes through the browser; the tokens travel directly from the authorization server to the client. *

  1. Initial request (front channel): the client redirects the user agent (browser) to the authorization server with its client ID, the requested scope, a local state value and the redirect URI.
  2. User authenticates (front channel): the resource owner logs in at the authorization server and consents.
  3. Response with authorization code (front channel): the authorization server redirects the user agent back to the redirect URI with the authorization code and the unchanged state.
  4. Request for access token (back channel): the client sends the code, its client authentication and the redirect URI directly to the authorization server's token endpoint (grant_type=authorization_code).
  5. Response with access token (back channel): the server returns the access token and optionally a refresh token.

Front channel means the message travels through the browser (as a redirect URL that the user, browser extensions and history can see). Back channel means a direct, TLS-protected server-to-server HTTP request that the browser never touches.

Go deeper:

From Quiz: IAM / Authentication Protocols: OAuth 2.0 and OpenID Connect | Updated: Oct 22, 2026