The six OAuth 2.0 flows with their current standing, step by step: who sends what, which parameters are required, and what goes wrong with each.
Authorization code with PKCE · recommended
A user is signing in — from a web app, a single-page app, or a mobile app. This is the default answer.
For almost every case the answer is authorization code with PKCE — including single-page applications, which is a change from the advice of a few years ago. Implicit and password are listed because you will meet them in existing systems, not because they are alternatives to choose between.
The user authorises at the provider, which returns a short-lived code to your redirect URI; your app exchanges that code for a token. PKCE binds the exchange to the client that started it, so an intercepted code is useless on its own.
code_verifier and its code_challengeThe verifier is 43–128 random characters from a cryptographic source. The challenge is the base64url of its SHA-256 — S256. The plain method exists and provides no protection.
/authorizeWith response_type=code, your client_id, the exact redirect_uri, the scopes, a random state, and the code_challenge.
At the provider, on the provider's own domain. Your app never sees the password, which is the point.
A short-lived, single-use code in the query string, along with the state you sent.
state before anything elseIt must equal the value you generated and stored. This is what stops a CSRF against the redirect endpoint, and skipping it is a real vulnerability.
/tokenPOST the code with the original code_verifier. The provider hashes it and compares to the challenge it stored.
An access token, usually a refresh token, and sometimes an ID token.
This is reference material, not a configuration tool. Nothing here is sent anywhere, no provider is contacted, and no credential is requested — to take apart a real authorisation URL or redirect, use the OAuth URL inspector, which also runs entirely in your browser.
Flows change. The implicit flow was standard advice and is now withdrawn; PKCE moved from a public-client recommendation to a universal one. Treat this as orientation and follow RFC 6749, the OAuth 2.0 Security Best Current Practice, and your provider’s current documentation for anything you are about to build.
OAuth 2.0 Flow Explainer runs entirely on your device — this is static reference material and nothing you do here leaves the page.
You’re on the Free plan. Compare plans
This is organised around the question people actually arrive with, which is not how the authorization code flow works but which one to use. Each flow leads with when it applies and its current standing, and the answer for nearly every case is authorization code with PKCE — including for single-page applications, which is a change from the advice of a few years ago.
Two of the six are marked deprecated with the reason stated rather than being listed alongside the rest as equivalent options. Implicit returns the access token in the URL fragment, where it reaches browser history; it existed because browsers could not make cross-origin requests, and they can. Password sends the user's actual credentials through your application, which makes every protection the provider has — multi-factor, risk checks, device recognition — unreachable.
Each flow's steps name the actor as well as the action, because the security properties come from who holds what. The step that gets skipped most often is checking state on the redirect, and skipping it is a real vulnerability rather than an omission, so it is called out in the flow rather than in a footnote.
Authorization code with PKCE. The implicit flow was the standard advice for browser applications and is now withdrawn: the access token lands in the URL fragment, which reaches browser history and can leak through a Referer header.
Because your application handles the user's real credentials, which means the provider cannot apply multi-factor authentication, risk assessment or device recognition. It also trains users to type their password into anything that asks.
When there is no user — a service calling another service with its own identity. It is the correct flow for that case and the wrong one for anything acting on a person's behalf, since there is nobody to authorise.
Because without it your redirect endpoint will process a code from anywhere, which is a cross-site request forgery against the sign-in itself. Generate it randomly, store it, and compare it before anything else happens.
No. It is orientation, and flows change: PKCE moved from a public-client recommendation to a universal one. Follow RFC 6749, the OAuth 2.0 Security Best Current Practice and your provider's documentation for anything you are building.
If a tool here saved you some time, you can put something towards the hosting.Buy me a coffee, on Ko-fi, opens in a new tab