dpop-adoption

Implement OAuth 2.0 DPoP refresh token sender-constraining for WebCrypto and Node.js runtimes.

23.7k|2.0k|Updated Mar 31, 2026
Ready to run
npx skills add https://github.com/google/skills --skill dpop-adoption-google
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: dpop-adoption
Source: https://github.com/google/skills/tree/main/skills/identity/dpop-adoption
Command: npx skills add https://github.com/google/skills --skill dpop-adoption-google

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Refresh tokens are vulnerable to interception and replay attacks. DPoP (Demonstrating Proof-of-Possession, RFC 9449) cryptographically binds refresh tokens to a client's private key, preventing attackers from reusing stolen tokens without access to that key. ## Core Features & Use Cases - Non-extractable Key Pair Generation: Create P-256 ECDSA key pairs with private keys locked in the cryptographic boundary (Secure Enclave, Android KeyStore, or sandbox memory). - DPoP Proof JWT Creation: Generate signed JWTs with claims binding the proof to HTTP method, target URI, authorization code, or access token. - Token Endpoint Integration: Handle Google OAuth 2.0 token refresh with automatic nonce challenge retry logic for RFC 9449 compliance. - Use Case: A single-page application proxies OAuth through a Backend-for-Frontend server. The BFF generates DPoP proofs for each token refresh request to Google's token endpoint, ensuring stolen refresh tokens cannot be reused even if a database is compromised. ## Quick Start Generate a DPoP key pair, create a DPoP Proof JWT bound to your authorization code and token endpoint URI, and attach it to your POST request to oauth2.googleapis.com/token in the DPoP header.

Frequently Asked Questions about dpop-adoption

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement DPoP with Google OAuth 2.0 refresh tokens?▼

Generate a non-extractable P-256 key pair using WebCrypto, create a DPoP Proof JWT with claims binding the HTTP method (POST), target URI (oauth2.googleapis.com/token), and authorization code or access token, then attach it to the DPoP HTTP header in your token request.

What is the difference between RFC 9449 DPoP and standard Bearer tokens?▼

Bearer tokens grant access to anyone possessing them; DPoP binds tokens to a specific private key so only clients holding that key can use the token. Google's token endpoint issues Bearer access tokens, but refresh tokens are DPoP-constrained at the token endpoint itself.

Why does Google's token endpoint return HTTP 400 use_dpop_nonce?▼

The 400 use_dpop_nonce response is RFC-compliant workflow isolation enforcing separate nonce namespaces between authorization code exchange and token refresh. Cache the DPoP-Nonce header value, regenerate the DPoP Proof with the new nonce, and retry the token request exactly once.

Can I use DPoP in a client-side single-page application without a backend?▼

No; pure SPAs cannot use DPoP directly because they lack server-side client_secret and encounter CORS restrictions on the DPoP-Nonce response header. Implement a Backend-for-Frontend (BFF) proxy to handle authorization and DPoP token binding server-side.

What cryptographic signature format does DPoP require for P-256?▼

DPoP requires IEEE P1363 format: raw concatenated 32-byte r and s coordinates (64 bytes total). WebCrypto's crypto.subtle.sign already emits raw P1363 format, so directly base64url-encode the output without DER conversion.

How do I export the DPoP public key as a JWK?▼

Export the public key with crypto.subtle.exportKey('jwk', publicKey), ensuring it contains only kty (EC), crv (P-256), x, and y coordinates in base64url format without trailing equals-sign padding; never expose the private key parameter d.