[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6998PHPDCAD684VW5WRG83D":3,"skill-same:01M6998PHPDCAD684VW5WRG83D":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":31,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":6,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6998PHPDCAD684VW5WRG83D","dpop-adoption",null,"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\u002Ftoken. 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 \u002F service account authentication.","google\u002Fskills","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M698WR0H76ENHE587T9EJT89",23830,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fidentity\u002Fdpop-adoption\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":27,"categoryName":28,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,9],"adoption","dpop adoption","iam","when","platform","runtimes","identity","pair","token","node","at","loops","browser","code","challenge","flows","authentication","retry","es6","google cloud","2026-11-10 10:12:30",false,"---\nname: dpop-adoption\nmetadata:\n  version: \"1.0.1\"\n  category: Identity\ndescription: >-\n  Implement and debug OAuth 2.0 DPoP (RFC 9449) refresh token sender-constraining\n  for WebCrypto, Node.js ES6, and browser runtimes integrating with Google's OAuth\n  platform. Use when configuring non-extractable asymmetric key pairs (P-256),\n  generating DPoP Proof JWTs for authorization code exchange and token refresh, or\n  handling 400 use_dpop_nonce challenge retry loops at oauth2.googleapis.com\u002Ftoken.\n  Don't use for unconstrained OAuth 2.0 flows (where refresh tokens are not bound\n  to a client key pair), or for Google Cloud IAM \u002F service account authentication.\n---\n\n# DPoP Adoption & Identity Security Architecture\n\nDemonstrating Proof-of-Possession (DPoP, RFC 9449) secures OAuth 2.0 refresh\ntokens against interception and replay attacks by cryptographically binding them\nto a private key held exclusively by the client. In Google's OAuth 2.0 platform,\nDPoP binds the refresh token at the token endpoint, while access tokens issued\nfor Google APIs are standard Bearer tokens (`token_type: \"Bearer\"`).\n\n## 1. Core Cryptographic & Architectural Invariants\n\nWhen implementing DPoP helpers or upgrading HTTP clients, you MUST adhere to the\nfollowing strict security invariants:\n\n### A. Universal WebCrypto & Runtime Compatibility\n\n-   In modern ES6 JavaScript (`\"type\": \"module\"` for Node 18+ and browsers),\n    ALWAYS access `globalThis.crypto` directly after verifying the environment\n    context.\n-   **NEVER** import legacy CommonJS modules via `require('node:crypto')` or\n    reference browser-scoped `window.crypto`, as these cause module\n    initialization crashes across hybrid runtimes.\n\n### B. Hardware-Backed Non-Extractable Key Persistence\n\n-   Generate an Elliptic Curve key pair on the SECP256R1 (`P-256`) curve: `{\n    name: 'ECDSA', namedCurve: 'P-256' }`.\n-   **CRITICAL SECURITY GUARDRAIL:** The private key MUST be configured as\n    **non-extractable** (`extractable: false`). This guarantees the private key\n    can never leave the platform's cryptographic boundary (Secure Enclave,\n    Android KeyStore, or JS sandbox memory), thwarting XSS and dependency token\n    theft attacks.\n-   **Runtime Persistence Scope:** In-memory WebCrypto (`extractable: false`)\n    key generation applies to browser\u002FIndexedDB contexts and single-process\n    runtime harnesses; multi-instance or persistent server-side Node.js\n    deployments should bind DPoP private keys via KMS\u002FHSM\u002FTPM so bound refresh\n    tokens survive process restarts.\n-   The public key MUST remain exportable (`extractable: true`) to allow\n    emitting JSON Web Keys (JWKs).\n\n### C. Public JWK Formatting Standards\n\n-   When exporting public keys to attach to DPoP Proof JWT headers, construct a\n    clean JWK dictionary containing strictly:\n    -   `\"kty\": \"EC\"`\n    -   `\"crv\": \"P-256\"`\n    -   `\"x\"`: Base64URL-encoded x-coordinate without trailing equal sign\n        padding (`=`).\n    -   `\"y\"`: Base64URL-encoded y-coordinate without trailing equal sign\n        padding (`=`).\n-   **NEVER** expose private key parameters (`\"d\"`) or superfluous metadata.\n\n### D. IEEE P1363 vs. ASN.1 DER Signature Disambiguation\n\n-   DPoP Proof JWTs require raw concatenated coordinate signatures ($R \\parallel\n    S$, exactly 64 bytes for P-256) per IEEE P1363 and RFC 7518.\n-   **WebCrypto Native Rule:** In standard WebCrypto (`crypto.subtle.sign`),\n    ECDSA signatures are ALREADY emitted natively in raw IEEE P1363 format\n    (concatenated 32-byte `r` and `s` buffers, 64 bytes total). **DO NOT**\n    attempt DER-to-Raw conversion on `crypto.subtle.sign` outputs, as parsing a\n    64-byte raw buffer as ASN.1 DER causes an immediate runtime exception\n    (`Invalid DER sequence`). Directly base64url-encode the raw ArrayBuffer.\n-   **Legacy API Fallback:** If and only if implementing in legacy Java\u002FAndroid\n    (`java.security.Signature`) or Node CommonJS (`crypto.createSign`), convert\n    ASN.1 DER output to raw 64-byte IEEE P1363 format before base64url encoding.\n\n### E. SPA & Backend-for-Frontend (BFF) Architecture\n\n-   **Secretless SPAs Limitation:** Pure client-side single-page applications\n    (SPAs) without a backend cannot use DPoP directly with Google APIs due to\n    `client_secret` requirements on server endpoints and browser CORS\n    limitations on the `DPoP-Nonce` response header.\n-   **BFF Pattern:** To secure SPAs with DPoP, route authorization and token\n    refresh requests through a Backend-for-Frontend (BFF) server-side client.\n    The BFF sets `access_type=offline`, binds refresh tokens server-side using\n    DPoP, and maintains secure session cookies with the frontend.\n\n## 2. Implementation Rules & Mandatory Public API\n\nWhen creating new modules, your module MUST explicitly export all functions\nbelow to integrate cleanly with CI\u002FCD verification harnesses and automated\nprobers. When inspecting or refactoring existing codebases, ensure equivalent\ncryptographic and RFC 9449 logic is present. Obey strict claim derivation logic\nin all cases:\n\n### A. DPoP Proof JWT Claim Derivation Rules (`createDPoPProof`)\n\nWhen generating the DPoP Proof JWT in `createDPoPProof`:\n\n**1. JOSE Header (`typ`, `alg`, `jwk`):**\n```javascript\n\u002F\u002F Header\n{\n  \"typ\": \"dpop+jwt\",\n  \"alg\": \"ES256\",\n  \"jwk\": await exportPublicJWK(publicKey)\n}\n```\n\n**2. Payload Claims:**\n-   `\"htm\"`: Uppercase HTTP Method (`\"POST\"` for token requests).\n-   `\"htu\"`: Target URI stripped of query parameters and hash fragments using\n    `sanitizeHTU(htu)`. For token requests, this is\n    `https:\u002F\u002Foauth2.googleapis.com\u002Ftoken`.\n-   `\"iat\"`: Current integer epoch timestamp in seconds\n    (`Math.floor(Date.now() \u002F 1000)`).\n-   `\"jti\"` (Critical Invariant):\n    1.  If an explicit `jti` argument is provided to `createDPoPProof`, use that\n        exact string over all others.\n    2.  Otherwise, if an `authCode` argument is provided (during initial code\n        exchange), set `jti = await calculateAuthCodeJti(authCode)` where\n        `calculateAuthCodeJti` computes `base64url(sha256(authCode))` to ensure\n        the DPoP proof is cryptographically bound to the authorization code.\n    3.  Only if neither `jti` nor `authCode` is provided, generate a fresh\n        cryptographic random string via `generateRandomString()` (such as\n        `crypto.getRandomValues(new Uint8Array(24))` base64url encoded).\n-   `\"ath\"` (Optional): If an `accessToken` argument is provided for RFC 9449\n    resource requests, compute `base64url(sha256(accessToken))` via\n    `calculateATH(accessToken)` and inject it (RFC 9449 Section 6.1).\n-   `\"nonce\"` (Optional): If a `nonce` argument is provided, inject it directly\n    into the payload.\n\n### B. Explicit Export Signatures\n\n```javascript\n\u002F\u002F 1. Key generation & JWK export\nexport async function generateDPoPKeyPair() \u002F\u002F -> { publicKey, privateKey } (private key extractable=false)\nexport async function exportPublicJWK(publicKey) \u002F\u002F -> { kty: 'EC', crv: 'P-256', x, y }\n\n\u002F\u002F 2. Proof generation & validation\nexport async function createDPoPProof({ privateKey, publicKey, htm, htu, nonce, accessToken, authCode, jti }) \u002F\u002F -> signed JWT string\nexport async function verifyDPoPProof(dpopProofJwt) \u002F\u002F -> { isValid: boolean, header, payload, error }\nexport function sanitizeHTU(htu) \u002F\u002F -> URL stripped of query and hash: const u = new URL(htu); return `${u.origin}${u.pathname}`;\n\n\u002F\u002F 3. Cryptographic & encoding utilities\nexport function base64UrlEncode(buffer) \u002F\u002F -> Uint8Array\u002FArrayBuffer to base64url string without '=' padding\nexport function base64UrlDecode(str) \u002F\u002F -> base64url string to Uint8Array\u002FBuffer\nexport function stringToBase64Url(str) \u002F\u002F -> UTF-8 string to base64url\nexport function base64UrlToString(str) \u002F\u002F -> base64url to UTF-8 string\nexport function generateRandomString(byteLength = 32) \u002F\u002F -> cryptographic random base64url string\nexport async function calculateATH(accessToken) \u002F\u002F -> base64url(sha256(accessToken)) per RFC 9449 Sec 6.1\nexport async function calculateAuthCodeJti(code) \u002F\u002F -> base64url(sha256(code))\nexport async function generatePKCE() \u002F\u002F -> { codeVerifier (>=43 chars), codeChallenge, codeChallengeMethod: 'S256' }\n```\n\n## 3. Token Endpoint & Resource Request Workflow\n\nWhen integrating with Google's OAuth 2.0 platform:\n\n1.  **Token Endpoint Requests (`oauth2.googleapis.com\u002Ftoken`):**\n    -   Attach the DPoP Proof JWT in the `DPoP` HTTP header:\n        `` `DPoP: ${proofJwt}` `` when making `POST` requests for code exchange\n        (`grant_type=authorization_code`) and token refresh\n        (`grant_type=refresh_token`).\n2.  **Resource API Requests:**\n    -   Google's token endpoint returns `\"token_type\": \"Bearer\"`. Downstream\n        requests to Google APIs (e.g. Calendar, Drive, Gmail) use standard\n        `` `Authorization: Bearer ${accessToken}` `` headers without DPoP\n        headers.\n3.  **Single-Retry Nonce Challenge Loop & Workflow Isolation:**\n    -   If Google's token endpoint returns HTTP `400 Bad Request` with\n        `error: \"use_dpop_nonce\"` and a `\"DPoP-Nonce\"` response header:\n        -   **Workflow Isolation:** Google's authorization server enforces\n            workflow isolation between authorization code exchange and token\n            refresh, returning an HTTP `400 use_dpop_nonce` challenge to\n            establish a fresh nonce namespace. This is standard RFC-compliant\n            protocol behavior, not a server failure.\n        -   Cache the fresh nonce in client state (`this.dpopNonce`).\n        -   Immediately synthesize a new DPoP Proof JWT incorporating the\n            updated `nonce` claim and a fresh `jti`.\n        -   Replay the failed token request **exactly once**. If the retried\n            request fails, terminate immediately with an error to prevent\n            infinite recursion.\n\n## 4. Concise Agent Egress Protocol\n\nWhen prompted to synthesize or output code deliverables under this skill,\nprioritize returning clean, directly importable code blocks without redundant\nconversational preambles or repetitive filler. For conceptual or architectural\ninquiries, provide standard direct answers.\n\n## 5. References & Supporting Documentation\n\n### Developer Documentation (Google for Developers)\n-   [DPoP Adoption Guide](https:\u002F\u002Fdevelopers.google.com\u002Fidentity\u002Fprotocols\u002Foauth2\u002Fresources\u002Fdpop-adoption) —\n    Official Google Identity guide for implementing DPoP across authorization\n    code exchange and token refresh.\n-   [Using OAuth 2.0 for Web Server Applications](https:\u002F\u002Fdevelopers.google.com\u002Fidentity\u002Fprotocols\u002Foauth2\u002Fweb-server#offline) —\n    Offline access, refresh tokens, and server-side authorization flows.\n-   [OAuth 2.0 Best Practices: Sender-Constrain Tokens](https:\u002F\u002Fdevelopers.google.com\u002Fidentity\u002Fprotocols\u002Foauth2\u002Fresources\u002Fbest-practices#sender-constrain-tokens) —\n    Recommendations for token storage, rotation, and sender-constraining.\n\n### Developer Knowledge MCP Server\n-   Agents equipped with Model Context Protocol (`MCP`) can query real-time\n    Google Developer documentation using the\n    [Google Developer Knowledge MCP Server](https:\u002F\u002Fdevelopers.google.com\u002Fknowledge\u002Fmcp)\n    (`npx -y @google\u002Fmcp-developer-knowledge-server`) via\n    `developer_knowledge:search_documents` and\n    `developer_knowledge:get_documents`.\n\n### Standards & RFC Specifications\n-   [RFC 9449: OAuth 2.0 Demonstrating Proof-of-Possession (DPoP)](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc9449)\n-   [RFC 7519: JSON Web Token (JWT)](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc7519)\n-   [RFC 7636: Proof Key for Code Exchange by OAuth Public Clients (PKCE)](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc7636)\n","# DPoP Adoption & Identity Security Architecture\n\nDemonstrating Proof-of-Possession (DPoP, RFC 9449) secures OAuth 2.0 refresh\ntokens against interception and replay attacks by cryptographically binding them\nto a private key held exclusively by the client. In Google's OAuth 2.0 platform,\nDPoP binds the refresh token at the token endpoint, while access tokens issued\nfor Google APIs are standard Bearer tokens (`token_type: \"Bearer\"`).\n\n## 1. Core Cryptographic & Architectural Invariants\n\nWhen implementing DPoP helpers or upgrading HTTP clients, you MUST adhere to the\nfollowing strict security invariants:\n\n### A. Universal WebCrypto & Runtime Compatibility\n\n-   In modern ES6 JavaScript (`\"type\": \"module\"` for Node 18+ and browsers),\n    ALWAYS access `globalThis.crypto` directly after verifying the environment\n    context.\n-   **NEVER** import legacy CommonJS modules via `require('node:crypto')` or\n    reference browser-scoped `window.crypto`, as these cause module\n    initialization crashes across hybrid runtimes.\n\n### B. Hardware-Backed Non-Extractable Key Persistence\n\n-   Generate an Elliptic Curve key pair on the SECP256R1 (`P-256`) curve: `{\n    name: 'ECDSA', namedCurve: 'P-256' }`.\n-   **CRITICAL SECURITY GUARDRAIL:** The private key MUST be configured as\n    **non-extractable** (`extractable: false`). This guarantees the private key\n    can never leave the platform's cryptographic boundary (Secure Enclave,\n    Android KeyStore, or JS sandbox memory), thwarting XSS and dependency token\n    theft attacks.\n-   **Runtime Persistence Scope:** In-memory WebCrypto (`extractable: false`)\n    key generation applies to browser\u002FIndexedDB contexts and single-process\n    runtime harnesses; multi-instance or persistent server-side Node.js\n    deployments should bind DPoP private keys via KMS\u002FHSM\u002FTPM so bound refresh\n    tokens survive process restarts.\n-   The public key MUST remain exportable (`extractable: true`) to allow\n    emitting JSON Web Keys (JWKs).\n\n### C. Public JWK Formatting Standards\n\n-   When exporting public keys to attach to DPoP Proof JWT headers, construct a\n    clean JWK dictionary containing strictly:\n    -   `\"kty\": \"EC\"`\n    -   `\"crv\": \"P-256\"`\n    -   `\"x\"`: Base64URL-encoded x-coordinate without trailing equal sign\n        padding (`=`).\n    -   `\"y\"`: Base64URL-encoded y-coordinate without trailing equal sign\n        padding (`=`).\n-   **NEVER** expose private key parameters (`\"d\"`) or superfluous metadata.\n\n### D. IEEE P1363 vs. ASN.1 DER Signature Disambiguation\n\n-   DPoP Proof JWTs require raw concatenated coordinate signatures ($R \\parallel\n    S$, exactly 64 bytes for P-256) per IEEE P1363 and RFC 7518.\n-   **WebCrypto Native Rule:** In standard WebCrypto (`crypto.subtle.sign`),\n    ECDSA signatures are ALREADY emitted natively in raw IEEE P1363 format\n    (concatenated 32-byte `r` and `s` buffers, 64 bytes total). **DO NOT**\n    attempt DER-to-Raw conversion on `crypto.subtle.sign` outputs, as parsing a\n    64-byte raw buffer as ASN.1 DER causes an immediate runtime exception\n    (`Invalid DER sequence`). Directly base64url-encode the raw ArrayBuffer.\n-   **Legacy API Fallback:** If and only if implementing in legacy Java\u002FAndroid\n    (`java.security.Signature`) or Node CommonJS (`crypto.createSign`), convert\n    ASN.1 DER output to raw 64-byte IEEE P1363 format before base64url encoding.\n\n### E. SPA & Backend-for-Frontend (BFF) Architecture\n\n-   **Secretless SPAs Limitation:** Pure client-side single-page applications\n    (SPAs) without a backend cannot use DPoP directly with Google APIs due to\n    `client_secret` requirements on server endpoints and browser CORS\n    limitations on the `DPoP-Nonce` response header.\n-   **BFF Pattern:** To secure SPAs with DPoP, route authorization and token\n    refresh requests through a Backend-for-Frontend (BFF) server-side client.\n    The BFF sets `access_type=offline`, binds refresh tokens server-side using\n    DPoP, and maintains secure session cookies with the frontend.\n\n## 2. Implementation Rules & Mandatory Public API\n\nWhen creating new modules, your module MUST explicitly export all functions\nbelow to integrate cleanly with CI\u002FCD verification harnesses and automated\nprobers. When inspecting or refactoring existing codebases, ensure equivalent\ncryptographic and RFC 9449 logic is present. Obey strict claim derivation logic\nin all cases:\n\n### A. DPoP Proof JWT Claim Derivation Rules (`createDPoPProof`)\n\nWhen generating the DPoP Proof JWT in `createDPoPProof`:\n\n**1. JOSE Header (`typ`, `alg`, `jwk`):**\n```javascript\n\u002F\u002F Header\n{\n  \"typ\": \"dpop+jwt\",\n  \"alg\": \"ES256\",\n  \"jwk\": await exportPublicJWK(publicKey)\n}\n```\n\n**2. Payload Claims:**\n-   `\"htm\"`: Uppercase HTTP Method (`\"POST\"` for token requests).\n-   `\"htu\"`: Target URI stripped of query parameters and hash fragments using\n    `sanitizeHTU(htu)`. For token requests, this is\n    `https:\u002F\u002Foauth2.googleapis.com\u002Ftoken`.\n-   `\"iat\"`: Current integer epoch timestamp in seconds\n    (`Math.floor(Date.now() \u002F 1000)`).\n-   `\"jti\"` (Critical Invariant):\n    1.  If an explicit `jti` argument is provided to `createDPoPProof`, use that\n        exact string over all others.\n    2.  Otherwise, if an `authCode` argument is provided (during initial code\n        exchange), set `jti = await calculateAuthCodeJti(authCode)` where\n        `calculateAuthCodeJti` computes `base64url(sha256(authCode))` to ensure\n        the DPoP proof is cryptographically bound to the authorization code.\n    3.  Only if neither `jti` nor `authCode` is provided, generate a fresh\n        cryptographic random string via `generateRandomString()` (such as\n        `crypto.getRandomValues(new Uint8Array(24))` base64url encoded).\n-   `\"ath\"` (Optional): If an `accessToken` argument is provided for RFC 9449\n    resource requests, compute `base64url(sha256(accessToken))` via\n    `calculateATH(accessToken)` and inject it (RFC 9449 Section 6.1).\n-   `\"nonce\"` (Optional): If a `nonce` argument is provided, inject it directly\n    into the payload.\n\n### B. Explicit Export Signatures\n\n```javascript\n\u002F\u002F 1. Key generation & JWK export\nexport async function generateDPoPKeyPair() \u002F\u002F -> { publicKey, privateKey } (private key extractable=false)\nexport async function exportPublicJWK(publicKey) \u002F\u002F -> { kty: 'EC', crv: 'P-256', x, y }\n\n\u002F\u002F 2. Proof generation & validation\nexport async function createDPoPProof({ privateKey, publicKey, htm, htu, nonce, accessToken, authCode, jti }) \u002F\u002F -> signed JWT string\nexport async function verifyDPoPProof(dpopProofJwt) \u002F\u002F -> { isValid: boolean, header, payload, error }\nexport function sanitizeHTU(htu) \u002F\u002F -> URL stripped of query and hash: const u = new URL(htu); return `${u.origin}${u.pathname}`;\n\n\u002F\u002F 3. Cryptographic & encoding utilities\nexport function base64UrlEncode(buffer) \u002F\u002F -> Uint8Array\u002FArrayBuffer to base64url string without '=' padding\nexport function base64UrlDecode(str) \u002F\u002F -> base64url string to Uint8Array\u002FBuffer\nexport function stringToBase64Url(str) \u002F\u002F -> UTF-8 string to base64url\nexport function base64UrlToString(str) \u002F\u002F -> base64url to UTF-8 string\nexport function generateRandomString(byteLength = 32) \u002F\u002F -> cryptographic random base64url string\nexport async function calculateATH(accessToken) \u002F\u002F -> base64url(sha256(accessToken)) per RFC 9449 Sec 6.1\nexport async function calculateAuthCodeJti(code) \u002F\u002F -> base64url(sha256(code))\nexport async function generatePKCE() \u002F\u002F -> { codeVerifier (>=43 chars), codeChallenge, codeChallengeMethod: 'S256' }\n```\n\n## 3. Token Endpoint & Resource Request Workflow\n\nWhen integrating with Google's OAuth 2.0 platform:\n\n1.  **Token Endpoint Requests (`oauth2.googleapis.com\u002Ftoken`):**\n    -   Attach the DPoP Proof JWT in the `DPoP` HTTP header:\n        `` `DPoP: ${proofJwt}` `` when making `POST` requests for code exchange\n        (`grant_type=authorization_code`) and token refresh\n        (`grant_type=refresh_token`).\n2.  **Resource API Requests:**\n    -   Google's token endpoint returns `\"token_type\": \"Bearer\"`. Downstream\n        requests to Google APIs (e.g. Calendar, Drive, Gmail) use standard\n        `` `Authorization: Bearer ${accessToken}` `` headers without DPoP\n        headers.\n3.  **Single-Retry Nonce Challenge Loop & Workflow Isolation:**\n    -   If Google's token endpoint returns HTTP `400 Bad Request` with\n        `error: \"use_dpop_nonce\"` and a `\"DPoP-Nonce\"` response header:\n        -   **Workflow Isolation:** Google's authorization server enforces\n            workflow isolation between authorization code exchange and token\n            refresh, returning an HTTP `400 use_dpop_nonce` challenge to\n            establish a fresh nonce namespace. This is standard RFC-compliant\n            protocol behavior, not a server failure.\n        -   Cache the fresh nonce in client state (`this.dpopNonce`).\n        -   Immediately synthesize a new DPoP Proof JWT incorporating the\n            updated `nonce` claim and a fresh `jti`.\n        -   Replay the failed token request **exactly once**. If the retried\n            request fails, terminate immediately with an error to prevent\n            infinite recursion.\n\n## 4. Concise Agent Egress Protocol\n\nWhen prompted to synthesize or output code deliverables under this skill,\nprioritize returning clean, directly importable code blocks without redundant\nconversational preambles or repetitive filler. For conceptual or architectural\ninquiries, provide standard direct answers.\n\n## 5. References & Supporting Documentation\n\n### Developer Documentation (Google for Developers)\n-   [DPoP Adoption Guide](https:\u002F\u002Fdevelopers.google.com\u002Fidentity\u002Fprotocols\u002Foauth2\u002Fresources\u002Fdpop-adoption) —\n    Official Google Identity guide for implementing DPoP across authorization\n    code exchange and token refresh.\n-   [Using OAuth 2.0 for Web Server Applications](https:\u002F\u002Fdevelopers.google.com\u002Fidentity\u002Fprotocols\u002Foauth2\u002Fweb-server#offline) —\n    Offline access, refresh tokens, and server-side authorization flows.\n-   [OAuth 2.0 Best Practices: Sender-Constrain Tokens](https:\u002F\u002Fdevelopers.google.com\u002Fidentity\u002Fprotocols\u002Foauth2\u002Fresources\u002Fbest-practices#sender-constrain-tokens) —\n    Recommendations for token storage, rotation, and sender-constraining.\n\n### Developer Knowledge MCP Server\n-   Agents equipped with Model Context Protocol (`MCP`) can query real-time\n    Google Developer documentation using the\n    [Google Developer Knowledge MCP Server](https:\u002F\u002Fdevelopers.google.com\u002Fknowledge\u002Fmcp)\n    (`npx -y @google\u002Fmcp-developer-knowledge-server`) via\n    `developer_knowledge:search_documents` and\n    `developer_knowledge:get_documents`.\n\n### Standards & RFC Specifications\n-   [RFC 9449: OAuth 2.0 Demonstrating Proof-of-Possession (DPoP)](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc9449)\n-   [RFC 7519: JSON Web Token (JWT)](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc7519)\n-   [RFC 7636: Proof Key for Code Exchange by OAuth Public Clients (PKCE)](https:\u002F\u002Fdatatracker.ietf.org\u002Fdoc\u002Fhtml\u002Frfc7636)\n",{"name":5,"metadata":57,"description":7},{"version":58,"category":59},"1.0.1","Identity","main","cd6fde0b299b34bbad05f64ad1ed5bd2ed05e634","skills\u002Fidentity\u002Fdpop-adoption",1991,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-11 03:08:50",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add google\u002Fskills --skill dpop-adoption",{"tool":75,"command":76},"bunx","bunx skills add google\u002Fskills --skill dpop-adoption",{"tool":78,"command":79},"pnpm","pnpm dlx skills add google\u002Fskills --skill dpop-adoption","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fidentity\u002Fdpop-adoption\u002FSKILL.md",true,[],[84,114,143,170,195,217],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":94,"publishedAt":52},"01M6998S2EZKD3GEJ7F943RZTE","sign-in-with-google-web","Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS \u002F `https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fclient`) across web architectures. Use when creating Google sign-in buttons, implementing Google One Tap with FedCM, integrating GIS in React\u002FNext.js\u002FAngular\u002FHTML, verifying ID tokens on backend runtimes (Python\u002FNode.js\u002FGo\u002FJava), enforcing Google Workspace domain restrictions (`hd`), securing client-side ID tokens via WebCrypto nonces or encrypted IndexedDB, embedding in cross-origin iframes via the Intermediate Iframe API (`https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fintermediate`), configuring Content Security Policy (CSP), COOP, and Permissions Policy (`identity-credentials-get`) headers, or handling sign-out and revocation. Don't use for legacy Google Sign-In (`gapi.auth2`), Google Cloud IAM service accounts, or Android\u002FiOS native Credential Manager.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fidentity\u002Fsign-in-with-google-web\u002FSKILL.md",[90,93],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[9,95,96,97,98,99,100,101,102,51,103,104,105,106,107,34,108,109,110,111,38,112,113,37],"sign in with google web","sign","with","web","android","go","security","google workspace","implement","policy","python","implementing","react","permissions","buttons","secure","manager","architectures","domain",{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":126,"publishedAt":52},"01M6998M72TC73EEAQH4XC7EXW","retrieving-developer-knowledge","Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI\u002FGemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms. Integrates with the Developer Knowledge MCP server (search_documents, get_documents, answer_query) or the Developer Knowledge REST API fallback. Use when searching for gcloud CLI commands, API syntax, IAM permissions, official documentation, architectural comparisons, or product choice overviews. Don't use for local filesystem lookups or non-Google documentation.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Fretrieving-developer-knowledge\u002FSKILL.md",[120,121,124,125],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":122,"categoryName":123,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":27,"categoryName":28,"taxonomyType":29,"taxonomyTypeDesc":30},[127,128,129,130,51,131,132,133,134,135,136,137,138,35,139,140,141,34,142,108],"retrieving developer knowledge","knowledge","developer","MCP","mcp server","official","developer documentation","get","search","local","choice","documents","query","api","across","documentation",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":52},"01M6998J2CZEXS9BES9S3WWFKC","migrate-to-rust","Clones, analyzes, plans, and migrates legacy codebases (C++, Fortran, Java, Python, C, Shell) from a GitHub URL or local directory to a modern, high-performance, deterministic, 100% Safe Rust architecture, tracking live telemetry across every task bucket, test failure\u002Ffix cycle, and Profile-Guided Optimization (PGO) stage, and producing a first-person AI storytelling report and interactive HTML infographic. Use when migrating a GitHub repository or local codebase to Rust, porting legacy C++, Fortran, Python, or Java workloads to memory-safe Rust, designing Struct-of-Arrays (SoA) or SIMD Rust architectures, or optimizing Rust ports with LLVM PGO. Don't use for unrelated non-Rust refactoring or single-line syntax questions.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Fmigrate-to-rust\u002FSKILL.md",[],[150,151,152,153,154,155,156,157,105,158,159,160,161,162,163,136,164,165,166,35,167,168,141,169],"migrate to rust","rust","migrate","github","memory","performance","directory","safe","ports","llvm","soa","cycle","porting","fix","arrays","infographic","high-performance","URL","architecture","unrelated",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":179,"publishedAt":52},"01M6998GCC3K29WZ82KXMB9E02","finding-google-skills","Google platform decision and setup guidance, loaded on demand from Google's skill catalog. Use when a developer is choosing or setting up part of their stack, such as where to run a service, a database, storage, messaging, authentication, analytics, ads, or AI model serving, and a Google product is a reasonable candidate - whether or not a vendor is named - or when a request names a Google product or API. Brings in the matching Google skill so the answer can weigh Google options, their trade-offs, and when they are not the right fit. Skip when the stack is already settled on another provider and no Google product is named, or the task involves no platform choice.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Ffinding-google-skills\u002FSKILL.md",[176,177,178],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":27,"categoryName":28,"taxonomyType":29,"taxonomyTypeDesc":30},[9,180,181,182,183,36,184,185,186,187,188,48,189,190,191,137,192,193,35,194,140],"finding google skills","storage","as","messaging","model","trade-offs","provider","answer","fit","catalog","up","decision","use","database","candidate",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":203,"publishedAt":52},"01M6998DWNHTH0BS6W1CY8ZXMP","workload-manager-basics","Use this skill to manage Google Cloud Workload Manager evaluations, rules, scanned resources, and validation results by using public client libraries and the REST API. Use when you need to inspect workload best-practice rules, create and run evaluations for Google Cloud general best practices, SAP, SQL Server, or custom organizational rules, review violations, export results to BigQuery, or automate Workload Manager through client libraries because no service-specific public CLI or MCP server is available. Don't use for general Google Compute Engine instance management, VPC configuration, or standard IAM auditing.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fworkload-manager-basics\u002FSKILL.md",[201,202],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[204,205,111,206,9,130,207,51,131,208,209,210,211,35,212,140,34,213,214,215,216],"workload manager basics","workload","basics","cli","review","vpc","resources","inspect","you","create","libraries","server","run",{"skillNo":218,"name":219,"nameZh":6,"description":220,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":221,"categories":222,"keywords":223,"publishedAt":52},"01M6998BC1CC8QSEKKJSQ7VE1G","spanner-basics","Assists in provisioning instances and databases, designing performant schemas, and querying data in Cloud Spanner on Google Cloud. Use when designing primary keys, writing SQL queries or client library code, or diagnosing performance issues.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fspanner-basics\u002FSKILL.md",[],[224,206,9,225,51,155,226,227,228,229,192,35,45,230,231,232,233,234,235,236],"spanner basics","writing","sql queries","instances","databases","issues","queries","keys","sql","data","provisioning","cloud","client"]