Agent skill · google
dpop-adoption
Implement and debug OAuth 2.0 DPoP (RFC 9449) refresh token sender-constraining for WebCrypto, Node.js ES6, and browser runtimes integrating with Google's OAuth platform. Use when configuring non-extractable asymmetric key pairs (P-256), generating DPoP Proof JWTs for authorization code exchange and token refresh, or handling 400 use_dpop_nonce challenge retry loops at oauth2.googleapis.com/token. Don't use for unconstrained OAuth 2.0 flows (where refresh tokens are not bound to a client key pair), or for Google Cloud IAM / service account authentication.
What it needs
About 5k tokens when loaded.
What this skill does
DPoP Adoption & Identity Security Architecture Demonstrating Proof-of-Possession (DPoP, RFC 9449) secures OAuth 2.0 refresh tokens against interception and replay attacks by cryptographically binding them to a private key held exclusively by the client. In Google's OAuth 2.0 platform, DPoP binds the refresh token at the token endpoint, while access tokens issued for Google APIs are standard Bearer tokens (tokentype: "Bearer"). 1. Core Cryptographic & Architectural Invariants When implementing DPoP helpers or upgrading HTTP clients, you MUST adhere to the following strict security invariants: A. Universal WebCrypto & Runtime Compatibility In modern ES6 JavaScript ("type": "module" for Node 18+ and browsers), ALWAYS access globalThis.crypto directly after verifying the environment context. NEVER import legacy CommonJS modules via require('node:crypto') or reference browser-scoped window.crypto, as these cause module initialization crashes across hybrid runtimes. B. Hardware-Backed Non-Extractable Key Persistence Generate an Elliptic Curve key pair on the SECP256R1 (P-256) curve: { name: 'ECDSA', namedCurve: 'P-256' }. CRITICAL SECURITY GUARDRAIL: The private key MUST be configured as non-extractable (extractable: false). This guarantees the private key can never leave the hardware cryptographic boundary (Secure Enclave, Android KeyStore, or JS sandbox memory), thwarting XSS and dependency token theft attacks. The public key MUST remain exportable (extractable: true) to allow emitting JSON Web Keys (JWKs). C. Public JWK Formatting Standards When exporting public keys to attach to DPoP Proof JWT headers, construct a clean JWK dictionary containing strictly: "kty": "EC" "crv": "P-256" "x": Base64URL-encoded x-coordinate without trailing equal sign padding (=). "y": Base64URL-encoded y-coordinate without trailing equal sign padding (=). NEVER expose private key parameters ("d") or superfluous metadata. D. IEEE P1363 vs. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills google/dpop-adoption