Skip to content

DPoP proof generator

Generate an ES256 key and a signed DPoP proof for an HTTP method and URL (RFC 9449), with the public JWK and its thumbprint.

Runs in your browser. Nothing you paste is sent to us.

Request

The URL the proof is for. Query and fragment are left out of htu.

Set it when calling an API: the proof then carries ath, the hash of the token. Leave it empty for the token endpoint.

The value of a DPoP-Nonce header, when the server asked for one (use_dpop_nonce).

The key
A P-256 key made in your browser with Web Crypto. The private key cannot be exported and is gone when you close the tab, so tokens bound to it stop working then. Use it for testing.

DPoP proof

Proof JWT (send as the DPoP header)
 
Request headers
 
Header
 
Payload
 
Public JWK
 
Make a new proof for every request: each has its own jti, and servers accept a proof only for a short time after iat.

How to use it

  1. A key is made in your browser when the page opens.
  2. Pick the HTTP method and enter the URL the proof is for.
  3. For API calls, paste the access token so the proof carries ath.
  4. Copy the proof into the DPoP header, and make a new one for each request.

What to know

DPoP binds tokens to a key the client holds. Each request carries a short-lived JWT, the proof, signed with that key and naming the method (htm), URL (htu) and time (iat).

The proof’s header has typ dpop+jwt, the algorithm and the public JWK. The server puts the key’s thumbprint in the token as cnf.jkt, so a stolen token is useless without the key.

The key here is made with Web Crypto and cannot be exported. It is for testing and is gone when you close the tab.

What DPoP is

DPoP, short for Demonstrating Proof of Possession, binds OAuth tokens to a key that only the client holds. It is defined in RFC 9449.

A normal bearer token works for anyone who has it. If it leaks through a log, a proxy or a compromised browser extension, the thief can use it until it expires. With DPoP, the server binds the token to the client’s public key. Every request must then carry a fresh proof signed with the matching private key. A stolen token without the key is useless.

RFC 9700, the OAuth security best current practice, recommends sender-constrained access tokens, and names DPoP and mutual TLS as ways to get them. DPoP works at the application layer, so it suits browsers and mobile apps where client certificates are hard to use.

What a DPoP proof contains

A proof is a short-lived JWT, sent in a DPoP HTTP header. Its header names the key, and its payload names the request it is for.

PartFieldMeaning
HeadertypAlways dpop+jwt.
HeaderalgAn asymmetric signing algorithm, such as ES256. Never none or an HMAC.
HeaderjwkThe public key, without any private part.
PayloadjtiA unique id for this proof, so the server can spot replays.
PayloadhtmThe HTTP method of the request, such as POST.
PayloadhtuThe request URL, without query and fragment.
PayloadiatWhen the proof was made, in seconds since 1970.
PayloadathThe Base64url SHA-256 hash of the access token, when one is sent.
PayloadnonceA value the server asked for, when it uses nonces.

How DPoP works step by step

  1. The client makes a key pair and keeps the private key to itself.
  2. At the token endpoint, it sends a proof for POST and the token endpoint URL in a DPoP header.
  3. The server checks the proof and issues an access token bound to the key. The token response says token_type is DPoP, and the token records the key’s thumbprint in cnf.jkt.
  4. For each API call, the client sends Authorization: DPoP <token> and a new proof for that method and URL, with ath set to the hash of the token.
  5. The API checks the proof’s signature, htm, htu, iat, ath and that the proof’s key matches cnf.jkt in the token.
Sample token request with a proof (shortened, made-up values)
POST /realms/acme/protocol/openid-connect/token HTTP/1.1
Host: auth.example.com
Content-Type: application/x-www-form-urlencoded
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIs...SAMPLE

grant_type=authorization_code&code=SAMPLE_CODE&client_id=web-app&...
Sample token response (made-up values)
{
  "access_token": "SAMPLE_ACCESS_TOKEN",
  "token_type": "DPoP",
  "expires_in": 300
}

Server nonces

A server may require a nonce from itself in each proof, to limit how long a proof made in advance stays useful. It answers the first request with the error use_dpop_nonce and a DPoP-Nonce header. The client puts that value in the proof’s nonce claim and sends the request again.

Binding the authorization code

In the code flow, the client can also send dpop_jkt, the thumbprint of its key, in the authorization request. The server then binds the code to that key, so only the same key can redeem it (RFC 9449 section 10).

What this tool does

The tool makes a P-256 key pair in your browser with Web Crypto and signs DPoP proofs with it, using ES256.

  • It sets htm from the method you pick and htu from the URL you enter, with query and fragment removed.
  • It adds ath when you paste an access token, and nonce when you enter one.
  • It gives each proof a new random jti and the current iat.
  • It shows the proof, the request headers, the decoded header and payload, the public JWK and its RFC 7638 thumbprint, which is what the server records as cnf.jkt.

The private key is created as non-extractable. It cannot be exported, and it is gone when you close the tab. That makes the tool right for testing a server or learning the format, and wrong for anything that must keep working later. The tool also does not send requests or verify proofs from other clients.

How to use the tool

  1. Open the page. A key is made at once, and a proof for the sample token endpoint appears.
  2. Pick the HTTP method of the request you want to test.
  3. Enter the request URL. For a token request, use your token endpoint.
  4. For an API call, paste the access token so the proof carries ath.
  5. If the server answered use_dpop_nonce, copy its DPoP-Nonce header value into the nonce field.
  6. Copy the request headers into your test request. Press New proof before each new request.

Where DPoP pays off

Single-page apps

Tokens in a browser are exposed to cross-site scripting and extensions. A non-extractable Web Crypto key cannot be read by script, so even code that steals the token cannot copy the key. It can still make requests while it runs in the page, so DPoP limits the damage rather than removing it.

Mobile apps

A mobile app can keep the key in the platform’s secure hardware. Refresh tokens bound to that key cannot be used from another device.

Public clients and refresh tokens

Public clients have no secret, so a stolen refresh token is normally enough to get new tokens. With DPoP, refresh tokens issued to public clients are bound to the key, which RFC 9700 accepts as an alternative to refresh token rotation.

APIs that handle sensitive data

An API can refuse bearer tokens and accept only DPoP-bound ones, so a token copied out of a log cannot be replayed against it.

DPoP and Keycloak

Keycloak can issue DPoP-bound tokens. Support and the way to require it per client have changed across releases, so check the documentation for your version before relying on it. A server that supports DPoP lists dpop_signing_alg_values_supported in its discovery document, which you can read with the OIDC discovery viewer.

The proof flow is the same as with any server: send a proof to /realms/<realm>/protocol/openid-connect/token, then use Authorization: DPoP with a new proof at the API or at the UserInfo endpoint.

Common errors and how to fix them

invalid_dpop_proof

  • htm or htu does not match the request. Check the method, the scheme, the host and the path. Leave the query out of htu.
  • iat is too old or in the future. Make a new proof, and check the clock of the machine making it.
  • The proof was reused. Each proof needs its own jti; make a new one per request.
  • ath is missing or wrong on an API call. Hash the exact access token you send.
  • The proof was signed with a different key than the one the token is bound to.

use_dpop_nonce

Not a failure. Copy the DPoP-Nonce response header into the proof’s nonce and repeat the request. Nonces can change, so always use the latest one.

invalid_token at the API

The API may expect the DPoP scheme but received Bearer, or the other way round. A DPoP-bound token must be sent with Authorization: DPoP.

Security notes and best practices

  • Make the private key non-extractable where the platform allows it, and never send it anywhere.
  • Make a new proof for every request. Proofs are cheap.
  • Keep the key for the lifetime of the tokens bound to it. If the key is lost, the client must sign in again.
  • Use ES256 unless the server asks for something else; it is widely supported and its keys are small.
  • DPoP does not replace short token lifetimes, PKCE or careful redirect URIs. It adds a layer on top of them.

If you would rather not run and upgrade Keycloak yourself, read our docs on how we run it on a dedicated cluster per customer.

Questions

Frequently asked questions

What is a DPoP proof?

A short-lived JWT the client signs with its private key and sends in a `DPoP` header. It names the HTTP method, the URL and the time, and carries the public key. It proves the sender holds the key the token is bound to.

What is the difference between DPoP and bearer tokens?

Anyone who has a bearer token can use it. A DPoP-bound token works only together with a fresh proof signed by the client’s private key. A leaked DPoP token is useless without the key.

Should htu include the query string?

No. RFC 9449 says `htu` is the request URL without query and fragment. The tool strips them for you.

What is ath in a DPoP proof?

The Base64url-encoded SHA-256 hash of the access token. A proof sent with an access token to a protected resource must include it, so the proof cannot be paired with another token.

What does use_dpop_nonce mean?

The server wants a nonce of its own in the proof. Take the value of the `DPoP-Nonce` response header, put it in the proof’s `nonce` claim and send the request again.

Which algorithm should I use for DPoP?

An asymmetric one; `none` and HMAC algorithms are not allowed. ES256 on the P-256 curve is the common choice, and the one this tool uses.

How is the token bound to the key?

The server computes the SHA-256 thumbprint of the public key (RFC 7638) and stores it in the token’s `cnf.jkt` claim. The resource server compares it with the key in each proof.

Can I use the key from this tool in my app?

No. The private key cannot be exported and disappears when you close the tab. Use the tool to test servers and learn the format; your app must make and keep its own key.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.