dpop_client
DPoP proof JWTs for Dart, as specified by
RFC 9449. Everything
below runs in your browser, compiled from the package itself with
dart compile js — no key and no token leaves this page.
1. The key
Generated once per installation and persisted as a PEM or a JWK, whichever your storage prefers. The public half is derived from the private scalar, so only the one private string has to be kept.
The same key as a private JWK, which is what
crypto.subtle.exportKey('jwk', …) gives and what storage
holding JSON wants. Paste either form above:
—
Thumbprint (jkt), the value an authorization server binds a token to:
—
2. The request
The store holds one nonce per origin; the client adds it to every proof for that origin.
That timing is dart compile js arithmetic on
BigInt, which the browser runs an order of magnitude slower
than the Dart VM — the same proof takes well under a millisecond on a
server or in a Flutter app. On the web, keep the key in WebCrypto and sign
through a DPoPSigner instead: it is both faster and
unextractable.
3. The proof
JWT header — the public key travels with every proof:
—
Claims — note that htu has lost the query string, as §4.2 requires:
—
Headers to add to the request — the token goes under the DPoP scheme, not Bearer:
—
The signed token:
—