liveBook · Manning

Proof Key for Code Exchange

Also called PKCE

Proof Key for Code Exchange (PKCE) is an OAuth security extension in which a client proves possession of a per-request secret when exchanging an authorization code.

How 6 Manning books explain it

Software Security for Developers

Proof Key for Code Exchange is an OAuth extension in which a client proves possession of a per-request secret when exchanging an authorization code.

How it is used
Strengthens the OAuth authorization code flow for public clients that cannot safely store client secrets.
How deep it goes
Explains interception risk, verifier and challenge generation, hashing, and token exchange, without detailing implementation code.
Examples
Uses an intercepted authorization code, mobile and web clients, and a shopping-list application to illustrate the risk and defense.
What you can do after
Apply it via an OAuth authorization flow by generating a verifier, deriving its challenge, and presenting the verifier during token exchange.

Read how Software Security for Developers explains Proof Key for Code Exchange →

ASP.NET Core in Action, 3e

Authorization code with PKCE is an OAuth authorization flow that protects the authorization code exchange with a proof key generated by the client.

How it is used
Protects interactive OAuth authorization-code exchanges when a user delegates access to a resource.
How deep it goes
Defines PKCE’s protective role and contrasts grant choices, but does not detail proof-key generation or exchange mechanics.
Examples
Uses dogphotos.com accessing Facebook photos as an OAuth authorization example.
What you can do after
Evaluate/understand when authorization code with PKCE fits interactive OAuth flows instead of machine-only client credentials.

Read how ASP.NET Core in Action, 3e explains Proof Key for Code Exchange →

Secure APIs

Proof Key for Code Exchange (PKCE) is an OAuth security extension in which a client binds an authorization-code request to a proof derived from a secret.

How it is used
Protects OAuth authorization-code exchanges from intercepted-code attacks and access-token hijacking.
How deep it goes
Explains verifier generation, SHA-256 derivation, base64url encoding, request parameters, and the interception threat.
Examples
Uses a complete authorization URL containing code_challenge and code_challenge_method=S256.
What you can do after
Implement PKCE by generating a verifier, deriving its S256 challenge, and sending the required authorization parameters.

Read how Secure APIs explains Proof Key for Code Exchange →

Spring Security in Action, Second Edition

Proof key for code exchange is an OAuth extension that binds an authorization-code exchange to a client-generated secret to mitigate code interception.

How it is used
Protects authorization-code exchanges when client credentials or authorization codes might be intercepted.
How deep it goes
Explains verifier generation, challenge hashing, request placement, and authorization-server comparison without framework implementation details.
Examples
Uses random verifier and hash-derived challenge pseudocode, plus the two PKCE message steps.
What you can do after
Apply it by generating a verifier, sending its challenge during login, and presenting the verifier during token exchange.

Read how Spring Security in Action, Second Edition explains Proof Key for Code Exchange →

Grokking Software Architecture

PKCE is an OAuth 2.0 security extension that binds an authorization request to a client-generated code verifier to protect public clients from intercepted authorization codes.

How it is used
Protects public clients during OAuth 2.0 login when they cannot safely store a permanent client secret.
How deep it goes
Explains the temporary challenge and verifier protection, but does not detail their generation or implementation.
Examples
Uses mobile and single-page app logins and an intercepted authorization code to illustrate the protection.
What you can do after
Understand why an intercepted authorization code remains unusable without the client’s verifier.

Read how Grokking Software Architecture explains Proof Key for Code Exchange →

Building Distributed Applications that Work

Proof Key for Code Exchange is an OAuth security extension that binds an authorization-code exchange to the client that initiated it.

How it is used
Adds an optional security layer to the authorization-code flow, particularly for public clients.
How deep it goes
Defines PKCE as an OpenID Connect option but does not explain the authorization-code exchange mechanics.
Examples
Names `options.UsePkce` as the configuration switch without showing a PKCE-specific code example.
What you can do after
Configure PKCE by setting `options.UsePkce` in OpenID Connect options, particularly for public-client authorization-code flows.

Read how Building Distributed Applications that Work explains Proof Key for Code Exchange →

What to know first

Related concepts

Questions about Proof Key for Code Exchange

What is Proof Key for Code Exchange?

Proof Key for Code Exchange (PKCE) is an OAuth security extension in which a client proves possession of a per-request secret when exchanging an authorization code.

Which Manning books explain Proof Key for Code Exchange?

Software Security for Developers, ASP.NET Core in Action, 3e, Secure APIs, Spring Security in Action, Second Edition, Grokking Software Architecture and Building Distributed Applications that Work.

What should I know before learning Proof Key for Code Exchange?

Manning books that teach Proof Key for Code Exchange usually introduce authorization code flow, OAuth 2.1 and SHA-256 first.

What is Proof Key for Code Exchange also called?

Proof Key for Code Exchange is also called PKCE.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.