π¦ Step 1: Generate Code Verifier
π Step 2: Code Challenge Method
π Step 3: Complete Authorization URL (optional)
βΉοΈ What is PKCE?
PKCE (Proof Key for Code Exchange, RFC 7636) adds security to the OAuth 2.0 Authorization Code Flow, especially for public clients like mobile apps and SPAs.
How it works:
- Client generates random
code_verifier(43-128 chars) - Client creates
code_challenge = BASE64URL(SHA256(code_verifier)) - Client sends
code_challengein authorization request - Authorization server stores the challenge
- Client sends original
code_verifierin token request - Server verifies:
SHA256(code_verifier) == code_challenge
β οΈ Important: Save the code_verifier! You'll need it when exchanging the authorization code for tokens.
π Related Articles
π Privacy Notice
All calculations are performed locally in your browser using the Web Crypto API. No data is sent to any server. Your code_verifier and code_challenge never leave your device.