Pikkola OAuth, tool No. 74

Build the redirect, then read what comes back.

A login is four parameters you cannot see and one code that lives for a minute. This page makes the PKCE pair from the browser's random source, assembles the authorize URL the way each provider documents it, reads the callback and the ID token the way your server should, and prints the token request with the verifier already in place.

7
providers
4
benches
0
uploads

The studio

Four steps of one login

The pair, the redirect, the answer, the exchange. Each bench hands its result to the next one, and none of them talks to a network.

The pair

43 to 128 characters from A to Z, a to z, 0 to 9 and - . _ ~, drawn with crypto.getRandomValues. S256 sends the SHA-256 digest and never the verifier.

Check a pair you already have

What you keep, and what you send
  • code_verifier server only
  • code_challenge in the URL
  • code_challenge_method in the URL
  • state both ends
  • nonce the ID token

The verifier goes into the token request, not into a URL. The state comes back with the code and is compared before the code is used. The nonce comes back inside the ID token.

1 GET /authorize?code_challenge=E9Melhoa2Owv...&state=kM3pQ7xT... the browser leaves with the challenge
2 GET /auth/google/callback?code=4/0AX4Xf...&state=kM3pQ7xT... the provider answers, and the state comes back as a receipt
3 POST /token ... code_verifier=dBjftJeZ4CVP-... the server proves it holds the pair before it gets a token
Nothing leaves the tab

The verifier, the client id, the code and any token you paste are read by functions on this page. No request, no account, no storage. The Content-Security-Policy sets connect-src to none, so the page could not post them anywhere even if it tried.

Three parameters that make the fourth safe

A code in the URL is worth stealing for as long as it lives. PKCE makes the code useless to anyone who did not start the flow, state ties the callback to the browser that began it, and the nonce ties the ID token to that same request.

01

The verifier never travels

The browser keeps a random verifier and sends only its SHA-256 digest as code_challenge. When the code comes back, the token request carries the verifier and the server hashes it again. A code lifted from a redirect, a log or a screenshot fails without it.

02

State is a receipt, not a timer

State goes out with the request and must come back unchanged. Compare it before the code is exchanged, with the value the same session put there, and fail closed. A short state is easier to guess, and a missing one is an open redirect waiting for a code.

03

The token outlives the code

Once exchanged, the tokens are the login. Keep the refresh token out of the browser, check iss, aud and exp on every ID token, and treat the signature as a separate job with the provider's published keys. This page stops at the claims and says so.

Seven endpoints, one table

What each provider documents for the authorization code flow, checked against the builder in the studio. A parameter that lands in the URL here also lands in the URL there.

Provider Authorize endpoint PKCE nonce Worth knowing

Questions

Is the code, token or client secret sent anywhere?

No. Every step is a function in a JavaScript file on this domain. The Content-Security-Policy sets connect-src to none, so the page could not post a verifier or a token even if it wanted to. Load it once and it keeps working with the network off.

Does it verify the ID token signature?

No, and every token says so. Verifying means fetching the provider's keys and running an RSA or EC check, which belongs on the server with a library that is audited for it. What is checked here is the part that catches most mistakes: issuer, audience, expiry, nonce and the at_hash that binds the token to an access token.

Can I use the generated verifier in production?

The characters are random and the encoding follows the RFC, so the pair is as good as the browser's generator. What matters more is where it lives: keep the verifier in the server session or the app's keychain, send only the challenge, and discard the pair after the exchange.

Why does Naver show no PKCE parameters?

Naver's flow documents client_id, redirect_uri, state and response_type, and no code_challenge. The builder follows the provider and leaves PKCE out rather than sending a parameter the endpoint ignores. State is required there, so leaving it empty is an error rather than a warning.

Which redirect addresses are accepted?

An absolute https address, or http on localhost and 127.0.0.1 for a desktop or command line app. A wildcard, a fragment, a relative path or http on a public host is flagged, because the provider rejects it or the browser drops the code before your server sees it.

What does the at_hash check prove?

That the ID token was issued together with the access token you hold, by showing the left half of the token's SHA digest in the claim. Paste the access token and the digest is computed for the algorithm the token names. Without the token the page can only note that the claim exists.