DPoP proof
Demonstrating Proof of Possession (DPoP) prevents a stolen bearer value from being sufficient on its own. For every request, the host signs a fresh proof covering the normalized HTTP method and URL. When an access token is present, the proof also carries its hash; a company nonce can add server-provided freshness.
What the example proves​
- A new
jtiand proof are required for every attempt, retry, and redirect. htmand normalizedhtuprevent reuse on another request target.athbinds the proof to the token without embedding that token in the JWT.- Nonce challenges are handled by generating a fresh proof, never by mutating or replaying the old one.
- Replay protection is a server responsibility and must be atomic across the company's serving fleet.
The example creates and verifies a real ES256 proof, then attempts to verify it again to demonstrate rejection. Its model-visible result contains policy booleans only.
Run the Pydantic AI example or the Agent Runtimes example. See JOSE and DPoP for production key and replay-store requirements.