OAuth PKCE Generator and Flow Tester

Create a correct PKCE verifier and challenge, build and open the sign-in URL, paste the callback to check state and iss, then get the token request as curl or raw HTTP.

Tarayıcınızda çalışır. Dosyalarınız cihazınızdan asla çıkmaz. Nasıl kontrol edeceğinizi görün

…

Nasıl yapılır

  1. 1
    Generate values

    Press New verifier, state and nonce, and set the verifier length with the slider.

  2. 2
    Enter the request

    Fill in the authorization endpoint, client ID, redirect URI and scope, plus any optional parameters.

  3. 3
    Open the URL

    Copy the authorization URL or open it in a new tab and sign in.

  4. 4
    Check the callback

    Paste the address you landed on; the tool checks code, state and iss.

  5. 5
    Prepare the token request

    Copy the curl or raw HTTP request, or send it from the browser for a public test client.

  6. 6
    Verify a pair

    Use the verify tab to test any verifier and challenge your app produced.

Bu araç hakkında

PKCE, short for Proof Key for Code Exchange, stops a stolen authorization code from being useful. The client invents a random secret called the code verifier, sends only a SHA-256 hash of it with the sign-in request, and later proves it knows the original when it redeems the code. Mobile apps, single-page apps and, under current OAuth advice, server-side apps should all use it. Getting the details right is fiddly: the verifier has a strict alphabet and length, the challenge is Base64url without padding, and the same redirect URI must appear in both requests. This page walks through the whole authorization code flow with real values. It generates the verifier with the browser's cryptographic random generator, computes the S256 challenge, adds fresh state and nonce values, and assembles the authorization URL. When the provider sends the browser back, you paste the callback address and the tool checks it before you exchange the code.

Generating values correctly

The verifier uses only the 66 unreserved characters A-Z, a-z, 0-9, hyphen, dot, underscore and tilde, at a length you choose between 43 and 128. Random bytes are drawn with rejection sampling so every character is equally likely; the slider shows the resulting entropy in bits. The challenge is computed with WebCrypto SHA-256 and encoded as Base64url without padding, exactly as section 4.2 of RFC 7636 describes. State and nonce are 128-bit random tokens. You can edit any value, and the tool tells you at once if a hand-typed verifier is too short or contains characters such as plus or slash.

Building and testing the request

Fill in the authorization endpoint, client ID, redirect URI and scope, and optionally response_mode, prompt, login_hint and extra parameters such as audience or resource. The URL updates live and opens in a new tab. After signing in, paste the address the browser lands on into the callback tab. The checker reads the query and fragment, reports provider errors, confirms that a code arrived, flags tokens that came back in the URL, compares state with what you sent and, when the provider includes iss, compares it with the expected issuer.

Token request

The token tab writes the matching request as a curl command and as raw HTTP, with the code, redirect URI and verifier filled in and client authentication handled for public or confidential clients. For public test clients you can also send the request straight from your browser. A separate tab verifies any verifier and challenge pair you have, which helps when debugging a mobile app.

Limits

This is a learning and debugging tool for your own applications. Do not paste production client secrets anywhere. The browser token exchange is not possible when the token endpoint does not allow cross-origin calls, which is common; use curl then. The page does not decode or validate the returned tokens.

Çözümlü örnek

A developer tests a native app's login against a staging provider. The page generates a 64-character verifier (378 bits of entropy) and the challenge 1XcT... with method S256. The authorization URL includes response_type=code, client_id=notes-ios, redirect_uri=http://127.0.0.1:8400/callback, scope openid profile offline_access, state and nonce. After sign-in the browser shows http://127.0.0.1:8400/callback?code=Splx...&state=Qm9...&iss=https://staging.login.example.com. The checker reports the code, a matching state and a matching iss. The generated curl command posts grant_type=authorization_code with the same redirect URI and code_verifier, and the server answers with tokens because the hash of the verifier equals the stored challenge.

Kısaca

Sık sorulan sorular

Why is the plain method allowed at all?

RFC 7636 kept it for devices that cannot compute SHA-256. With plain the challenge equals the verifier, so anyone who sees the sign-in request also sees the secret. Always use S256 unless you truly have no hash function.

How long should the verifier be?

Anything from 43 to 128 characters is valid. Forty-three random characters already carry about 256 bits of entropy; the default of 64 leaves extra margin and works with every provider tested.

Do I still need state when I use PKCE?

PKCE protects against code injection and theft, and state protects against cross-site request forgery on your callback. Many servers also offer the iss parameter for mix-up protection. Use all of them; they are cheap.

Does a confidential web app need PKCE?

Current OAuth security advice says yes. It costs one hash and protects against stolen or injected codes even when the client also authenticates with a secret or key.

Is the generated verifier safe to use in production?

It comes from the browser's cryptographic generator, but a verifier must be created fresh for every sign-in by your app. Use this page to learn and debug, not as a source of long-lived secrets.

Why does my token request say invalid_grant?

Common causes are a code that was already used or expired, a redirect URI that differs by even one character from the first request, or a verifier that does not belong to the challenge. The verify tab checks the last one.

Tamamen ücretsizÜcret yok, kayıt yok
Dosyalar gizli kalırHer şey tarayıcınızda çalışır
Kendi dilinizde kolayBirçok dilde mevcut