OAuth 2.0 PKCE & Authorization URL Generator

Generate cryptographic code_verifier, SHA-256 code_challenge, and build complete OAuth 2.0 PKCE authorization URLs.

Provider:
Cryptographic PKCE Parameters (RFC 7636)
Generated Authorization URL
Token Exchange POST Request (cURL)

Why PKCE is Mandatory for Public Clients

In traditional OAuth 2.0 Authorization Code flow, a confidential client_secret is required to exchange the authorization code for an access token. Single Page Applications (SPAs) and mobile apps cannot safely hold a client secret without exposing it to decompilation or browser inspection. Proof Key for Code Exchange (PKCE - RFC 7636) eliminates the need for client secrets on public clients.

The PKCE Handshake Steps

  1. Create Verifier: The client creates a cryptographically random string (code_verifier).
  2. Create Challenge: The client hashes the verifier using SHA-256 and base64url encodes it to produce the code_challenge.
  3. Authorization Request: The client sends the code_challenge and code_challenge_method=S256 to the authorization server.
  4. Token Exchange: Upon receiving the authorization code callback, the client sends the original unhashed code_verifier in the POST token exchange request. The auth server computes SHA-256(code_verifier) and verifies it matches the original challenge before issuing the token.