Protocols
Saved & recent

PKCE

Also called: Proof Key for Code Exchange, S256

Proof Key for Code Exchange binds an OAuth authorization request to the later code exchange. The client generates a random verifier, sends a derived challenge with the first request, and supplies the verifier when redeeming the code. The server checks that the two correspond.

For example, with the S256 method the challenge is a base64url-encoded SHA-256 hash of the verifier. Someone intercepting only the authorization code cannot redeem it without that verifier. PKCE is not a replacement for HTTPS, redirect validation, or client authentication where client authentication is required.

Read first
OAuth 2.0
Related
Authorization code flow, HTTPS
Further reading
RFC 7636 — Proof Key for Code Exchange by OAuth Public Clients
client authorization server verifier kept S256 challenge authorization request · challenge returns code token request · code + verifier original challenge recomputed challenge challenge match required S256 hashing
With the S256 PKCE method, the client retains a random verifier and sends only its derived challenge with the authorization request. The token exchange later supplies code and verifier; the server recomputes the challenge and compares them. Hashing is not encryption.

View in the full Protocols collection