The authorization code flow sends the user to an authorization server, returns a short-lived code, and exchanges it for tokens. PKCE binds that exchange to the client that started it, and OAuth 2.1 makes PKCE mandatory while removing riskier flows such as the implicit grant.
Read in this order
- ArticleOAuth 2.0 PlaygroundStart here: step through the authorization code flow and PKCE yourself.
- OfficialRFC 7636: Proof Key for Code Exchange by OAuth Public ClientsThe short PKCE spec, with the attack it prevents explained up front.
- OfficialRFC 6749: The OAuth 2.0 Authorization FrameworkThe core OAuth 2.0 framework, for exact grant types and error handling.