Skip to content

DPoP, tokens bound to a key

Make a token useless to anyone who steals it, by binding it to the caller's private key with DPoP (RFC 9449).

Applies to EngineCloud
View as Markdown
On this page
  1. How it works
  2. Optional or required

A normal access token is a bearer token: whoever holds it can use it. A DPoP token is bound to a key pair, and every request must carry a fresh proof signed with the private key. A stolen token, from a log, a proxy or a leaked file, does nothing on its own.

How it works

  1. The client generates a key pair (Ed25519 or P-256) and keeps the private key.
  2. When it asks for a token, it adds a header DPoP: with a small signed JWT: the method, the address, the time and a random id, plus the public key.
  3. The engine issues the token with "token_type": "DPoP" and the key’s thumbprint in cnf.jkt.
  4. On every call, the client sends Authorization: DPoP <token> and a new proof for that method and address, including ath, the hash of the token.
  5. The engine checks the proof’s signature, that its key matches cnf.jkt, that it is less than 60 seconds old and that its id was never seen in the last 5 minutes.
Text
GET /rest/v1/orders?select=id HTTP/1.1
Host: <ref>.data.sypnia.com
Authorization: DPoP eyJhbGciOiJFZERTQSJ9…
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7Imt0eSI6Ik9LUCIsImNydiI6IkVkMjU1MTkiLCJ4IjoiLi4uIn19…

Optional or required

Per client, dpop_bound_access_tokens:

  • off: DPoP is used if the client sends a proof, ignored otherwise;
  • on: the token endpoint refuses requests without a proof.

Clients created by npx @sypnia/data login (the device flow) always use DPoP. When a public client (no secret) gets a refresh token with DPoP, the refresh token is bound to the same key.

The engine may answer 401 with a DPoP-Nonce header; the client then repeats the request with that nonce in the proof. @sypnia/data handles proofs and nonces for you.

  1. How it works
  2. Optional or required

    Search pages, sections and terms