PKCE Code Generator

Make an OAuth 2.0 PKCE code verifier and its S256 code challenge, with a sample authorization request and token exchange to test your login flow.

Processed on your device. Files are not uploaded

How to make a PKCE code challenge

  1. Make a verifier

    A random code verifier is made for you, or paste your own.

  2. Copy the challenge

    Send code_challenge and code_challenge_method with the authorization request.

  3. Finish the flow

    Send the code_verifier with the token request. The sample requests show both steps.

When to use PKCE Code Generator

You are testing an OAuth or OpenID Connect provider by hand and need a matching code verifier and challenge.

Your app's login fails with invalid_grant and you want to check whether it computes the challenge correctly.

Tips for a better PKCE Code Generator result

Paste the verifier your app logged into the own verifier box and compare the challenge it shows with the one in the authorization URL.

Fill in the authorization address, client id and redirect URI to get a full request you can open in the browser.

PKCE Code Generator: limits and what to check

A verifier must be used once and kept secret until the token request, so never put a real one in logs or tickets.

Some providers also require a client secret or a registered redirect URI, so a correct challenge alone does not guarantee a working login.

About PKCE Code Generator

PKCE (Proof Key for Code Exchange) protects the OAuth authorization code flow for mobile apps, single-page apps and, now, every client. The app keeps a random secret, sends only its SHA-256 hash at the start, and proves it has the secret when it swaps the code for tokens.

FAQs

Why S256 and not plain?

With plain, anyone who sees the authorization request also sees the secret. S256 sends only a hash, and every current provider supports it.

How long should the verifier be?

Between 43 and 128 characters from letters, digits and - . _ ~. 64 is a good choice.

Can I check my own code?

Yes. Paste the verifier your app made and compare the challenge with the one it sent.

Related tools