Start with Identity
← Glossary
Protocol

PKCE

Proof Key for Code Exchange (RFC 7636). A binding between an authorization request and the code exchange that prevents intercepted authorization codes from being redeemed. Originally for mobile and SPA clients; OAuth 2.1 requires PKCE for all clients.

PKCE started as a mobile fix for codes intercepted through custom URL schemes and is now recommended for every client including confidential ones, which is why OAuth 2.1 makes it mandatory. The mechanism is simple: the client commits to a secret verifier at request time and must produce it at exchange time, so a stolen code alone is worthless. There is no reason to omit it in new code.

See also: authorization code flow, OAuth 2.1, OIDC authorization code with PKCE recipe, OAuth 2.0

Last reviewed By SWI Community TeamSuggest a correctionHow we research