[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EGF84C9M9PK81SY4TF4TV9":3,"skill-same:01M7EGF84C9M9PK81SY4TF4TV9":102},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":66,"commitSha":67,"skillDirectory":68,"forksCount":69,"repositoryHtmlUrl":70,"repositoryHomepageUrl":6,"ownerHtmlUrl":71,"ownerBlogUrl":6,"ownerDescription":72,"updatedAt":73,"install":74,"resources":87},"01M7EGF84C9M9PK81SY4TF4TV9","configuring-oauth2-authorization-flow",null,"Configures secure OAuth 2.0 authorization flows, including Authorization Code with PKCE, Client Credentials, and Device Authorization Grant, covering flow selection, PKCE implementation, token lifecycle management, and scope design per OAuth 2.1. Use when implementing or hardening OAuth 2.0 authentication\u002Fauthorization for web, mobile, SPA, or machine-to-machine clients.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-oauth2-authorization-flow\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: configuring-oauth2-authorization-flow\ndescription: Configures secure OAuth 2.0 authorization flows, including Authorization\n  Code with PKCE, Client Credentials, and Device Authorization Grant, covering flow\n  selection, PKCE implementation, token lifecycle management, and scope design per\n  OAuth 2.1. Use when implementing or hardening OAuth 2.0 authentication\u002Fauthorization\n  for web, mobile, SPA, or machine-to-machine clients.\ndomain: cybersecurity\nsubdomain: identity-access-management\ntags:\n- iam\n- identity\n- access-control\n- authentication\n- authorization\n- oauth2\n- oidc\n- pkce\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.AA-01\n- PR.AA-02\n- PR.AA-05\n- PR.AA-06\nmitre_attack:\n- T1528\n- T1550.001\n- T1539\n- T1606.001\n- T1212\nmitre_f3:\n  version: '1.1'\n  tactics:\n  - initial-access\n  - positioning\n  techniques:\n  - id: T1550.001\n    name: 'Use Alternate Authentication Material: Application Access Token'\n    tactic: initial-access\n    source: attack\n  - id: F1004\n    name: Access with Stolen Session Cookie\n    tactic: initial-access\n    source: f3\n  - id: F1006\n    name: Account Takeover\n    tactic: initial-access\n    source: f3\n  - id: T1539\n    name: Steal Web Session Cookie\n    tactic: positioning\n    source: attack\n---\n# Configuring OAuth 2.0 Authorization Flow\n\n## Overview\nConfigure secure OAuth 2.0 authorization flows including Authorization Code with PKCE, Client Credentials, and Device Authorization Grant. This skill covers flow selection, PKCE implementation, token lifecycle management, scope design, and alignment with OAuth 2.1 security requirements.\n\n\n## When to Use\n\n- When deploying or configuring configuring oauth2 authorization flow capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Familiarity with identity access management concepts and tools\n- Access to a test or lab environment for safe execution\n- Python 3.8+ with required dependencies installed\n- Appropriate authorization for any testing activities\n\n## Objectives\n- Implement Authorization Code flow with PKCE for public and confidential clients\n- Configure Client Credentials flow for machine-to-machine communication\n- Design least-privilege scope hierarchies\n- Implement secure token storage, refresh, and revocation\n- Apply OAuth 2.1 best practices and RFC 9700 security recommendations\n- Validate token integrity and prevent common OAuth attacks\n\n## Key Concepts\n\n### OAuth 2.0 Grant Types\n1. **Authorization Code + PKCE**: Recommended for all client types (web, mobile, SPA). PKCE is mandatory in OAuth 2.1.\n2. **Client Credentials**: Machine-to-machine authentication without user context.\n3. **Device Authorization Grant (RFC 8628)**: For input-constrained devices (smart TVs, CLI tools).\n4. **Refresh Token**: Long-lived token to obtain new access tokens without re-authentication.\n\n### PKCE (Proof Key for Code Exchange)\nPKCE (RFC 7636) prevents authorization code interception attacks:\n1. Client generates random `code_verifier` (43-128 characters, unreserved URI chars)\n2. Client computes `code_challenge = BASE64URL(SHA256(code_verifier))`\n3. Authorization request includes `code_challenge` and `code_challenge_method=S256`\n4. Token request includes original `code_verifier`\n5. Server validates `SHA256(code_verifier)` matches stored `code_challenge`\n\n### Token Types\n- **Access Token**: Short-lived (5-60 min), bearer or DPoP-bound\n- **Refresh Token**: Long-lived, single-use with rotation\n- **ID Token (OIDC)**: JWT containing user identity claims\n\n## Workflow\n\n### Step 1: Authorization Code Flow with PKCE\n1. Generate cryptographically random code_verifier (min 43 chars)\n2. Compute code_challenge using S256 method\n3. Redirect user to authorization endpoint with parameters:\n   - response_type=code\n   - client_id, redirect_uri, scope, state\n   - code_challenge, code_challenge_method=S256\n4. User authenticates and consents\n5. Authorization server redirects with authorization code\n6. Exchange code + code_verifier for tokens at token endpoint\n7. Validate state parameter matches original value\n\n### Step 2: Scope Design\n- Define granular scopes: `read:users`, `write:orders`, `admin:settings`\n- Follow least-privilege: request minimum scopes needed\n- Implement scope validation on resource server\n- Document scope hierarchy and consent requirements\n\n### Step 3: Token Security\n- Store tokens securely (httpOnly cookies for web, keychain for mobile)\n- Implement token refresh with rotation (one-time-use refresh tokens)\n- Set appropriate expiration: access tokens 5-15 min, refresh tokens 8-24 hrs\n- Enable DPoP (Demonstration of Proof-of-Possession) for sender-constrained tokens\n- Implement token revocation endpoint\n\n### Step 4: Client Credentials Flow\n1. Register service client with client_id and client_secret\n2. Request token: POST \u002Foauth\u002Ftoken with grant_type=client_credentials\n3. Include scope for required permissions\n4. Store client_secret securely (vault, env vars, not code)\n5. Implement certificate-based client authentication for higher assurance\n\n### Step 5: Security Hardening\n- Enforce PKCE for all authorization code flows\n- Use exact redirect URI matching (no wildcards)\n- Implement CSRF protection with state parameter\n- Enable refresh token rotation and revocation on reuse detection\n- Apply RFC 9700 security best practices\n- Block implicit grant and ROPC (removed in OAuth 2.1)\n\n## Security Controls\n| Control | NIST 800-53 | Description |\n|---------|-------------|-------------|\n| Access Control | AC-3 | Token-based access enforcement |\n| Authentication | IA-5 | Client credential management |\n| Session Management | SC-23 | Token lifecycle management |\n| Audit | AU-3 | Log all token issuance and revocation |\n| Cryptographic Protection | SC-13 | PKCE and token signing |\n\n## Common Pitfalls\n- Using implicit grant (removed in OAuth 2.1) instead of authorization code + PKCE\n- Storing tokens in localStorage (XSS vulnerable) instead of httpOnly cookies\n- Not validating state parameter enabling CSRF attacks\n- Using wildcard redirect URIs allowing open redirect exploitation\n- Not implementing refresh token rotation allowing token theft persistence\n\n## Verification\n- [ ] Authorization Code + PKCE flow completes successfully\n- [ ] PKCE code_challenge validated at token endpoint\n- [ ] State parameter prevents CSRF\n- [ ] Access tokens expire within configured lifetime\n- [ ] Refresh token rotation issues new refresh token each use\n- [ ] Token revocation invalidates both access and refresh tokens\n- [ ] Client Credentials flow works for service-to-service calls\n- [ ] Scopes correctly enforced at resource server\n","# Configuring OAuth 2.0 Authorization Flow\n\n## Overview\nConfigure secure OAuth 2.0 authorization flows including Authorization Code with PKCE, Client Credentials, and Device Authorization Grant. This skill covers flow selection, PKCE implementation, token lifecycle management, scope design, and alignment with OAuth 2.1 security requirements.\n\n\n## When to Use\n\n- When deploying or configuring configuring oauth2 authorization flow capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Familiarity with identity access management concepts and tools\n- Access to a test or lab environment for safe execution\n- Python 3.8+ with required dependencies installed\n- Appropriate authorization for any testing activities\n\n## Objectives\n- Implement Authorization Code flow with PKCE for public and confidential clients\n- Configure Client Credentials flow for machine-to-machine communication\n- Design least-privilege scope hierarchies\n- Implement secure token storage, refresh, and revocation\n- Apply OAuth 2.1 best practices and RFC 9700 security recommendations\n- Validate token integrity and prevent common OAuth attacks\n\n## Key Concepts\n\n### OAuth 2.0 Grant Types\n1. **Authorization Code + PKCE**: Recommended for all client types (web, mobile, SPA). PKCE is mandatory in OAuth 2.1.\n2. **Client Credentials**: Machine-to-machine authentication without user context.\n3. **Device Authorization Grant (RFC 8628)**: For input-constrained devices (smart TVs, CLI tools).\n4. **Refresh Token**: Long-lived token to obtain new access tokens without re-authentication.\n\n### PKCE (Proof Key for Code Exchange)\nPKCE (RFC 7636) prevents authorization code interception attacks:\n1. Client generates random `code_verifier` (43-128 characters, unreserved URI chars)\n2. Client computes `code_challenge = BASE64URL(SHA256(code_verifier))`\n3. Authorization request includes `code_challenge` and `code_challenge_method=S256`\n4. Token request includes original `code_verifier`\n5. Server validates `SHA256(code_verifier)` matches stored `code_challenge`\n\n### Token Types\n- **Access Token**: Short-lived (5-60 min), bearer or DPoP-bound\n- **Refresh Token**: Long-lived, single-use with rotation\n- **ID Token (OIDC)**: JWT containing user identity claims\n\n## Workflow\n\n### Step 1: Authorization Code Flow with PKCE\n1. Generate cryptographically random code_verifier (min 43 chars)\n2. Compute code_challenge using S256 method\n3. Redirect user to authorization endpoint with parameters:\n   - response_type=code\n   - client_id, redirect_uri, scope, state\n   - code_challenge, code_challenge_method=S256\n4. User authenticates and consents\n5. Authorization server redirects with authorization code\n6. Exchange code + code_verifier for tokens at token endpoint\n7. Validate state parameter matches original value\n\n### Step 2: Scope Design\n- Define granular scopes: `read:users`, `write:orders`, `admin:settings`\n- Follow least-privilege: request minimum scopes needed\n- Implement scope validation on resource server\n- Document scope hierarchy and consent requirements\n\n### Step 3: Token Security\n- Store tokens securely (httpOnly cookies for web, keychain for mobile)\n- Implement token refresh with rotation (one-time-use refresh tokens)\n- Set appropriate expiration: access tokens 5-15 min, refresh tokens 8-24 hrs\n- Enable DPoP (Demonstration of Proof-of-Possession) for sender-constrained tokens\n- Implement token revocation endpoint\n\n### Step 4: Client Credentials Flow\n1. Register service client with client_id and client_secret\n2. Request token: POST \u002Foauth\u002Ftoken with grant_type=client_credentials\n3. Include scope for required permissions\n4. Store client_secret securely (vault, env vars, not code)\n5. Implement certificate-based client authentication for higher assurance\n\n### Step 5: Security Hardening\n- Enforce PKCE for all authorization code flows\n- Use exact redirect URI matching (no wildcards)\n- Implement CSRF protection with state parameter\n- Enable refresh token rotation and revocation on reuse detection\n- Apply RFC 9700 security best practices\n- Block implicit grant and ROPC (removed in OAuth 2.1)\n\n## Security Controls\n| Control | NIST 800-53 | Description |\n|---------|-------------|-------------|\n| Access Control | AC-3 | Token-based access enforcement |\n| Authentication | IA-5 | Client credential management |\n| Session Management | SC-23 | Token lifecycle management |\n| Audit | AU-3 | Log all token issuance and revocation |\n| Cryptographic Protection | SC-13 | PKCE and token signing |\n\n## Common Pitfalls\n- Using implicit grant (removed in OAuth 2.1) instead of authorization code + PKCE\n- Storing tokens in localStorage (XSS vulnerable) instead of httpOnly cookies\n- Not validating state parameter enabling CSRF attacks\n- Using wildcard redirect URIs allowing open redirect exploitation\n- Not implementing refresh token rotation allowing token theft persistence\n\n## Verification\n- [ ] Authorization Code + PKCE flow completes successfully\n- [ ] PKCE code_challenge validated at token endpoint\n- [ ] State parameter prevents CSRF\n- [ ] Access tokens expire within configured lifetime\n- [ ] Refresh token rotation issues new refresh token each use\n- [ ] Token revocation invalidates both access and refresh tokens\n- [ ] Client Credentials flow works for service-to-service calls\n- [ ] Scopes correctly enforced at resource server\n",{"name":5,"tags":24,"author":33,"domain":34,"license":15,"version":35,"mitre_f3":36,"nist_csf":56,"subdomain":61,"description":7,"mitre_attack":62},[25,26,27,28,29,30,31,32],"iam","identity","access-control","authentication","authorization","oauth2","oidc","pkce","mahipal","cybersecurity","1.0",{"tactics":37,"version":40,"techniques":41},[38,39],"initial-access","positioning","1.1",[42,46,50,53],{"id":43,"name":44,"source":45,"tactic":38},"T1550.001","Use Alternate Authentication Material: Application Access Token","attack",{"id":47,"name":48,"source":49,"tactic":38},"F1004","Access with Stolen Session Cookie","f3",{"id":51,"name":52,"source":49,"tactic":38},"F1006","Account Takeover",{"id":54,"name":55,"source":45,"tactic":39},"T1539","Steal Web Session Cookie",[57,58,59,60],"PR.AA-01","PR.AA-02","PR.AA-05","PR.AA-06","identity-access-management",[63,43,54,64,65],"T1528","T1606.001","T1212","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fconfiguring-oauth2-authorization-flow",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":75,"prompt":85,"zipAvailable":86},[76,79,82],{"tool":77,"command":78},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill configuring-oauth2-authorization-flow",{"tool":80,"command":81},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill configuring-oauth2-authorization-flow",{"tool":83,"command":84},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill configuring-oauth2-authorization-flow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-oauth2-authorization-flow\u002FSKILL.md",true,[88,94,98],{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fapi-reference.md","REFERENCE","参考文档",1572,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-oauth2-authorization-flow\u002Freferences\u002Fapi-reference.md",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fstandards.md",2270,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-oauth2-authorization-flow\u002Freferences\u002Fstandards.md",{"path":99,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fworkflows.md",5472,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-oauth2-authorization-flow\u002Freferences\u002Fworkflows.md",[103,112,117,124,131,138],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":111},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":113,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":111},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":111},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":111},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":111},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":107,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":111},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]