A focused PKCE (Proof Key for Code Exchange, RFC 7636) tool for OAuth2 / OIDC developers:
- Pick a mode: Generate (a fresh pair), Validate (audit a verifier you have), or Verify (check a verifier/challenge pair match).
- Generate mode derives a codeverifier from cryptographically secure random bytes (choose 32/48/64/96 bytes = 256/384/512/768 bits) and base64url-encodes it, then computes codechallenge = BASE64URL(SHA256(verifier)). The verifier stays client-side; only the challenge goes to the authorization server.
- Validate mode audits an existing verifier against RFC 7636: length 43–128 characters, charset restricted to [A-Za-z0-9-._~], and ≥256 bits of entropy. If compliant it also shows the S256 challenge the verifier implies.
- Verify mode recomputes BASE64URL(SHA256(verifier)) and compares it to a provided codechallenge — useful when debugging "invalidgrant" or mismatched challenge errors during the token exchange.
- Optionally fill in the authorization endpoint, client ID and redirect URI to build the full authorization-request URL (with codechallengemethod=S256) and the token-exchange body that later sends the secret verifier.
Offline and cryptographically sound: random bytes come from the platform CSPRNG; SHA256 via the crypto module. No network calls, no value leaves the browser.