[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M783ZETBDQ8QR2GZ6FE8V3VF":3,"skill-same:01M783ZETBDQ8QR2GZ6FE8V3VF":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M783ZETBDQ8QR2GZ6FE8V3VF","oauth-implementation",null,"OAuth 2.0 and OpenID Connect authentication with secure flows. Use for third-party integrations, SSO systems, token-based API access, or encountering authorization code flow, PKCE, token refresh, scope management errors.","aibizmod\u002Faibizmod-service-web","aibizmod","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F295315630?v=4","01M7836CB8EQY701YQ7N88M591","01M7836CBVPZGNSJ8BRP2BT398",0,"MIT","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Foauth-implementation\u002Fskills\u002Foauth-implementation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: oauth-implementation\ndescription: OAuth 2.0 and OpenID Connect authentication with secure flows. Use for third-party integrations, SSO systems, token-based API access, or encountering authorization code flow, PKCE, token refresh, scope management errors.\nlicense: MIT\n---\n\n# OAuth Implementation\n\nImplement OAuth 2.0 and OpenID Connect for secure authentication.\n\n## OAuth 2.0 Flows\n\n| Flow | Use Case |\n|------|----------|\n| Authorization Code | Web apps (most secure) |\n| Authorization Code + PKCE | SPAs, mobile apps |\n| Client Credentials | Service-to-service |\n| Refresh Token | Session renewal |\n\n## Authorization Code Flow (Express)\n\n```javascript\nconst express = require('express');\nconst jwt = require('jsonwebtoken');\n\n\u002F\u002F Step 1: Redirect to authorization\napp.get('\u002Fauth\u002Flogin', (req, res) => {\n  const state = crypto.randomBytes(16).toString('hex');\n  req.session.oauthState = state;\n\n  const params = new URLSearchParams({\n    client_id: process.env.CLIENT_ID,\n    redirect_uri: process.env.REDIRECT_URI,\n    response_type: 'code',\n    scope: 'openid profile email',\n    state\n  });\n\n  res.redirect(`${PROVIDER_URL}\u002Fauthorize?${params}`);\n});\n\n\u002F\u002F Step 2: Handle callback\napp.get('\u002Fauth\u002Fcallback', async (req, res) => {\n  if (req.query.state !== req.session.oauthState) {\n    return res.status(400).json({ error: 'Invalid state' });\n  }\n\n  const tokenResponse = await fetch(`${PROVIDER_URL}\u002Ftoken`, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application\u002Fx-www-form-urlencoded' },\n    body: new URLSearchParams({\n      grant_type: 'authorization_code',\n      code: req.query.code,\n      redirect_uri: process.env.REDIRECT_URI,\n      client_id: process.env.CLIENT_ID,\n      client_secret: process.env.CLIENT_SECRET\n    })\n  });\n\n  const tokens = await tokenResponse.json();\n  \u002F\u002F Store tokens securely and create session\n});\n```\n\n## PKCE for Public Clients\n\n```javascript\nfunction generatePKCE() {\n  const verifier = crypto.randomBytes(32).toString('base64url');\n  const challenge = crypto\n    .createHash('sha256')\n    .update(verifier)\n    .digest('base64url');\n  return { verifier, challenge };\n}\n```\n\n## Security Requirements\n\n- Always use HTTPS\n- Validate redirect URIs strictly\n- Use PKCE for public clients\n- Store tokens in HttpOnly cookies\n- Implement token rotation\n- Use short-lived access tokens (15 min)\n\n## Additional Implementations\n\nSee [references\u002Fpython-java.md](references\u002Fpython-java.md) for:\n- Python Flask with Authlib OIDC provider\n- OpenID Connect discovery and JWKS endpoints\n- Java Spring Security OAuth2 server\n- Token introspection and revocation\n\n## Never Do\n\n- Store tokens in localStorage\n- Use implicit flow\n- Skip state parameter validation\n- Expose client secrets in frontend\n- Use long-lived access tokens\n","# OAuth Implementation\n\nImplement OAuth 2.0 and OpenID Connect for secure authentication.\n\n## OAuth 2.0 Flows\n\n| Flow | Use Case |\n|------|----------|\n| Authorization Code | Web apps (most secure) |\n| Authorization Code + PKCE | SPAs, mobile apps |\n| Client Credentials | Service-to-service |\n| Refresh Token | Session renewal |\n\n## Authorization Code Flow (Express)\n\n```javascript\nconst express = require('express');\nconst jwt = require('jsonwebtoken');\n\n\u002F\u002F Step 1: Redirect to authorization\napp.get('\u002Fauth\u002Flogin', (req, res) => {\n  const state = crypto.randomBytes(16).toString('hex');\n  req.session.oauthState = state;\n\n  const params = new URLSearchParams({\n    client_id: process.env.CLIENT_ID,\n    redirect_uri: process.env.REDIRECT_URI,\n    response_type: 'code',\n    scope: 'openid profile email',\n    state\n  });\n\n  res.redirect(`${PROVIDER_URL}\u002Fauthorize?${params}`);\n});\n\n\u002F\u002F Step 2: Handle callback\napp.get('\u002Fauth\u002Fcallback', async (req, res) => {\n  if (req.query.state !== req.session.oauthState) {\n    return res.status(400).json({ error: 'Invalid state' });\n  }\n\n  const tokenResponse = await fetch(`${PROVIDER_URL}\u002Ftoken`, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application\u002Fx-www-form-urlencoded' },\n    body: new URLSearchParams({\n      grant_type: 'authorization_code',\n      code: req.query.code,\n      redirect_uri: process.env.REDIRECT_URI,\n      client_id: process.env.CLIENT_ID,\n      client_secret: process.env.CLIENT_SECRET\n    })\n  });\n\n  const tokens = await tokenResponse.json();\n  \u002F\u002F Store tokens securely and create session\n});\n```\n\n## PKCE for Public Clients\n\n```javascript\nfunction generatePKCE() {\n  const verifier = crypto.randomBytes(32).toString('base64url');\n  const challenge = crypto\n    .createHash('sha256')\n    .update(verifier)\n    .digest('base64url');\n  return { verifier, challenge };\n}\n```\n\n## Security Requirements\n\n- Always use HTTPS\n- Validate redirect URIs strictly\n- Use PKCE for public clients\n- Store tokens in HttpOnly cookies\n- Implement token rotation\n- Use short-lived access tokens (15 min)\n\n## Additional Implementations\n\nSee [references\u002Fpython-java.md](references\u002Fpython-java.md) for:\n- Python Flask with Authlib OIDC provider\n- OpenID Connect discovery and JWKS endpoints\n- Java Spring Security OAuth2 server\n- Token introspection and revocation\n\n## Never Do\n\n- Store tokens in localStorage\n- Use implicit flow\n- Skip state parameter validation\n- Expose client secrets in frontend\n- Use long-lived access tokens\n",{"name":5,"license":14,"description":7},"main","9f54582c8b485462d402d7e70feaef34801746b9",".opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Foauth-implementation\u002Fskills\u002Foauth-implementation","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web","https:\u002F\u002Fgithub.com\u002Faibizmod","2026-09-24 00:48:11",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add aibizmod\u002Faibizmod-service-web --skill oauth-implementation",{"tool":35,"command":36},"bunx","bunx skills add aibizmod\u002Faibizmod-service-web --skill oauth-implementation",{"tool":38,"command":39},"pnpm","pnpm dlx skills add aibizmod\u002Faibizmod-service-web --skill oauth-implementation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Foauth-implementation\u002Fskills\u002Foauth-implementation\u002FSKILL.md",true,[43],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"references\u002Fpython-java.md","REFERENCE","参考文档",6732,"https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Foauth-implementation\u002Fskills\u002Foauth-implementation\u002Freferences\u002Fpython-java.md",[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":18},"01M7846EAPZWCQ8C6G3AAMMR57","{TODO=lowercase-hyphen-case-name}","[TODO: Write comprehensive description in third-person. Start with \"This skill provides...\" or \"This skill should be used when...\"]\n\n[TODO: Add \"Use when\" scenarios - specific situations where Claude should use this skill]\n\n[TODO: Add keywords - technologies, use cases, error messages that should trigger this skill]","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Ftemplates\u002Fskill-skeleton\u002Fskills\u002Fskill-name\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M7846A0WGDKJTDPD5QMHQVFV","zustand-state-management","Zustand state management for React with TypeScript. Use for global state, Redux\u002FContext API migration, localStorage persistence, slices pattern, devtools, Next.js SSR, or encountering hydration errors, TypeScript inference issues, persist middleware problems, infinite render loops.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fzustand-state-management\u002Fskills\u002Fzustand-state-management\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M78463GGSP9B3JSF146B2MG0","zod","TypeScript-first schema validation and type inference. Use for validating API requests\u002Fresponses, form data, env vars, configs, defining type-safe schemas with runtime validation, transforming data, generating JSON Schema for OpenAPI\u002FAI, or encountering missing validation errors, type inference issues, validation error handling problems. Zero dependencies (2kb gzipped).","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fzod\u002Fskills\u002Fzod\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7845ZX17SVNNY7EDGPJHSBT","xss-prevention","XSS attack prevention with input sanitization, output encoding, Content Security Policy. Use for user-generated content, rich text editors, web application security, or encountering stored XSS, reflected XSS, DOM manipulation, script injection errors.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fxss-prevention\u002Fskills\u002Fxss-prevention\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7845ST1H37YHSXWWQ9N0V0S","wordpress-plugin-core","WordPress plugin development with hooks, security, REST API, custom post types. Use for plugin creation, $wpdb queries, Settings API, or encountering SQL injection, XSS, CSRF, nonce errors.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fwordpress-plugin-core\u002Fskills\u002Fwordpress-plugin-core\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7845PTWD5HWSTGP35Q8TFNY","woocommerce-dev-cycle","Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow in WooCommerce projects.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fwoocommerce-dev-cycle\u002Fskills\u002Fwoocommerce-dev-cycle\u002FSKILL.md",[],[]]