What it is
PKCE — Proof Key for Code Exchange, pronounced "pixy" — is an extension to the OAuth 2.0 authorization code flow, defined in RFC 7636. Before redirecting the user to sign in, the client generates a random secret called the code verifier and sends only a derived code challenge, normally the SHA-256 hash of the verifier (method S256). When it later exchanges the authorization code for tokens, it must present the original verifier. The authorization server hashes it and refuses the exchange unless it matches the challenge it received.
Why it matters
An authorization code travels through the browser, where it can be intercepted by a malicious app, a leaky redirect or a log. Without PKCE, whoever holds the code can redeem it. With PKCE the code is useless on its own, because only the client that started the flow knows the verifier. That is why it matters most for apps that cannot keep a client secret — single-page apps, mobile apps, CLIs and desktop tools — and why current guidance now recommends it for every client, confidential ones included.
Key components
- Code verifier — a high-entropy random string (43–128 characters) kept by the client
- Code challenge — BASE64URL(SHA-256(verifier)) sent with the authorization request
- code_challenge_method — S256 (recommended) or plain
- Verifier presented at the token exchange and checked by the authorization server
How it connects
PKCE hardens the OAuth 2.0 authorization code flow rather than replacing it. On Salesforce it applies to the web server (authorization code) flow, and a Connected App or External Client App can be set to require it. The Model Context Protocol authorization spec requires MCP clients to implement PKCE, so it is part of connecting an agent to a protected server.
Good to know
PKCE replaces the implicit flow for browser apps; it does not replace client authentication for a server that can hold a secret — a confidential client should use both. Always use S256: the plain method sends the verifier itself as the challenge and only exists for clients that cannot hash.
Related terms
MCP (Model Context Protocol)
Anthropic's open standard for connecting AI models to external data sources and tools. Think of it as a universal adapter for AI.
Capability-Based Authorization
Authorizing an AI agent by granting narrow, revocable permissions for specific actions, rather than handing it a broad API key or a human's full access.
Headless Architecture
A software design pattern that separates backend logic and data from the presentation layer, letting any frontend — UI, API, agent, or CLI — consume the same business capabilities.
OAuth 2.0
The authorization framework (RFC 6749) that lets an application act on a user’s behalf with a scoped access token instead of the user’s password.
PKCE (Proof Key for Code Exchange) in practice
Articles from the Funnelists Team that put this term to work.

