Authorization Code Flow

The standard OAuth 2.0 flow for server-side applications with a confidential client (RFC 6749 §4.1). The authorization code is exchanged server-to-server, keeping access tokens away from the browser.

Try in Looking Glass
Server-side

Sequence Diagram

Click any step for details

ClientAuth ServerUserAPI1Authorization Request2User Authentication3User Consent4Authorization Code Response5Token Exchange Request6Token Response7API Request with Token8Protected Resource Response
Request
Response
Redirect
Internal

Step-by-Step Breakdown

1
Authorization Request
ClientAuthorization Server
2
User Authentication
UserAuthorization Server
3
User Consent
UserAuthorization Server
4
Authorization Code Response
Authorization ServerClient
5
Token Exchange Request
ClientAuthorization Server
6
Token Response
Authorization ServerClient
7
API Request with Token
ClientResource Server
8
Protected Resource Response
Resource ServerClient

Token Inspector

Specs for this flow

Sections of the protocol that normatively define this flow, plus the security considerations that apply to it.

Core specs

· The specifications that define this protocol.

Security & privacy

· Dedicated security and privacy considerations.