Security · 58 tools · nothing uploads

PKCE code verifier and challenge

Generate an OAuth 2.0 PKCE code verifier and its S256 code challenge, on your device, for an authorization code flow.

PKCE code verifier and challenge draws 32 random bytes with crypto.getRandomValues, base64url-encodes them as code_verifier, then SHA-256 hashes and base64url-encodes that string again as code_challenge. Only the S256 challenge method is offered, since every current OAuth guidance recommends it over the legacy plain method. There are no options, so a fresh, unrelated pair comes out on every run.

Questions

What challenge method does it use?

Only S256, the SHA-256-based method every current OAuth guidance recommends over the legacy plain method.

How is code_verifier generated?

32 random bytes from crypto.getRandomValues, base64url-encoded.

How is code_challenge computed?

SHA-256 of the verifier string, then base64url-encoded again.

What options can I set?

None; every run produces a fresh, unrelated pair.

What is this used for?

RFC 7636 Proof Key for Code Exchange, used in an OAuth 2.0 authorization code flow to prevent code interception.

Related Security tools