1 min lesson
Why PKCE and why not implicit
Use "Naming that when asked 'why not implicit' signals you track the current spec" to say what a strong answer must include.
Step 1 of 2
Why PKCE and why not implicit
A public client (a desktop app, a SPA) can't keep a secret - anything shipped to a user's machine can be extracted. PKCE solves this without a secret: the client generates a random code_verifier, sends its SHA-256 hash up front, then proves possession when it redeems the code. An intercepted authorization code is worthless without the verifier.
PKCE in three moves (conceptual)
code_verifier = random(64) // kept in memory on the client
code_challenge = base64url(sha256(code_verifier))
// 1. authorize: ?code_challenge=...&code_challenge_method=S256
// 2. user logs in -> redirect back with ?code=...
// 3. token: POST { code, code_verifier } // server recomputes the hashImplicit returned tokens directly in the redirect URL fragment, where they leaked into history, referrer headers and logs. It's deprecated and PKCE replaced it for browser clients. Naming that when asked "why not implicit" signals you track the current spec.