[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78GWY6VF76M5P3N44VGX1VP":3,"skill-same:01M78GWY6VF76M5P3N44VGX1VP":56},{"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":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":39,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M78GWY6VF76M5P3N44VGX1VP","building-api-authentication",null,"Build secure API authentication systems with OAuth2, JWT, API keys, and session management.\nUse when implementing secure authentication flows.\nTrigger with phrases like \"build authentication\", \"add API auth\", or \"secure the API\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fapi-development--api-authentication-builder--building-api-authentication\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: building-api-authentication\ndescription: |\n  Build secure API authentication systems with OAuth2, JWT, API keys, and session management.\n  Use when implementing secure authentication flows.\n  Trigger with phrases like \"build authentication\", \"add API auth\", or \"secure the API\".\n  \nallowed-tools: Read, Write, Edit, Grep, Glob, Bash(api:auth-*)\nversion: 1.0.0\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\nlicense: MIT\ncompatible-with: claude-code, codex, openclaw\ntags: [api, authentication, api-authentication]\n---\n# Building API Authentication\n\n## Overview\n\nBuild secure API authentication systems supporting JWT Bearer tokens, OAuth 2.0 authorization code and client credentials flows, API key management, and session-based authentication. Implement token issuance, validation, refresh rotation, revocation, and role-based access control (RBAC) with scoped permissions across all API endpoints.\n\n## Prerequisites\n\n- Cryptographic library: `jsonwebtoken` (Node.js), `PyJWT` (Python), or `jjwt` (Java)\n- Secure secret storage: environment variables, AWS Secrets Manager, or HashiCorp Vault for JWT signing keys\n- Database table for user credentials, refresh tokens, and API key storage\n- Bcrypt or Argon2 for password hashing (never store plaintext passwords)\n- OAuth 2.0 provider credentials for third-party auth integration (Google, GitHub, Auth0)\n\n## Instructions\n\n1. Examine existing authentication setup using Grep and Read, identifying current auth mechanisms, middleware placement, and any endpoints bypassing authentication.\n2. Implement JWT token issuance on successful login: sign with RS256 (asymmetric) or HS256 (symmetric), including `sub` (user ID), `iat`, `exp` (15-minute access token), `roles`, and `scopes` in the payload.\n3. Create authentication middleware that extracts the Bearer token from the `Authorization` header, verifies the signature and expiration, and injects the decoded user context into the request object.\n4. Implement refresh token rotation: issue a long-lived refresh token (30 days) alongside the access token, store a hash of the refresh token in the database, and rotate on each refresh (invalidating the previous token).\n5. Build role-based access control (RBAC) middleware that checks `user.roles` against endpoint-required roles, supporting both role-level (`admin`, `user`) and scope-level (`read:users`, `write:orders`) authorization.\n6. Add API key authentication as an alternative to JWT for machine-to-machine communication: generate cryptographically random keys, store hashed values, and validate against the `X-API-Key` header.\n7. Implement OAuth 2.0 client credentials flow for service-to-service authentication, with token caching and automatic renewal before expiration.\n8. Add brute-force protection on login endpoints: rate limit to 5 attempts per minute per IP, implement progressive lockout (15 min, 1 hour) after repeated failures, and log all authentication attempts.\n9. Write security tests covering: valid\u002Finvalid\u002Fexpired tokens, refresh token rotation, role enforcement, API key validation, brute-force lockout, and token revocation.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fimplementation.md` for the full implementation guide.\n\n## Output\n\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Fjwt.js` - JWT token issuance, verification, and refresh logic\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Fmiddleware.js` - Bearer token authentication middleware\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Frbac.js` - Role-based and scope-based access control middleware\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Fapi-keys.js` - API key generation, hashing, and validation\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Foauth.js` - OAuth 2.0 flow implementations\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Froutes\u002Fauth.js` - Login, register, refresh, and logout endpoints\n- `${CLAUDE_SKILL_DIR}\u002Ftests\u002Fauth\u002F` - Authentication and authorization security tests\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| 401 Token Expired | JWT `exp` claim is in the past | Client should attempt token refresh; if refresh fails, redirect to login |\n| 401 Invalid Signature | JWT signed with different key or tampered payload | Verify signing key matches between issuance and validation; check for key rotation issues |\n| 403 Insufficient Scope | Authenticated user lacks required role\u002Fscope for endpoint | Return required scope in error body; log authorization failure with user and endpoint details |\n| Refresh token reuse | Previously rotated refresh token used (possible token theft) | Invalidate all user sessions immediately; alert user of potential compromise; require re-authentication |\n| API key leaked | API key exposed in client-side code, logs, or version control | Revoke compromised key immediately; issue replacement; scan for exposure source |\n\nRefer to `${CLAUDE_SKILL_DIR}\u002Freferences\u002Ferrors.md` for comprehensive error patterns.\n\n## Examples\n\n**JWT with refresh rotation**: Login returns `{accessToken (15min), refreshToken (30d)}`; client stores refresh token securely; on 401, client calls `POST \u002Fauth\u002Frefresh` with old refresh token, receives new pair, old refresh token is invalidated.\n\n**Multi-provider OAuth**: Support \"Sign in with Google\" and \"Sign in with GitHub\" using OAuth 2.0 authorization code flow, creating local user accounts on first sign-in and linking subsequent provider connections.\n\n**API key with scoped permissions**: Generate API keys with specific scopes (`read:analytics`, `write:webhooks`), stored as SHA-256 hashes, displayed to the user only once at creation, with key rotation support.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fexamples.md` for additional examples.\n\n## Resources\n\n- RFC 7519 JSON Web Token (JWT): https:\u002F\u002Ftools.ietf.org\u002Fhtml\u002Frfc7519\n- RFC 6749 OAuth 2.0 Authorization Framework\n- OWASP Authentication Cheat Sheet: https:\u002F\u002Fcheatsheetseries.owasp.org\u002F\n- Auth0 architecture patterns: https:\u002F\u002Fauth0.com\u002Fdocs\u002F","# Building API Authentication\n\n## Overview\n\nBuild secure API authentication systems supporting JWT Bearer tokens, OAuth 2.0 authorization code and client credentials flows, API key management, and session-based authentication. Implement token issuance, validation, refresh rotation, revocation, and role-based access control (RBAC) with scoped permissions across all API endpoints.\n\n## Prerequisites\n\n- Cryptographic library: `jsonwebtoken` (Node.js), `PyJWT` (Python), or `jjwt` (Java)\n- Secure secret storage: environment variables, AWS Secrets Manager, or HashiCorp Vault for JWT signing keys\n- Database table for user credentials, refresh tokens, and API key storage\n- Bcrypt or Argon2 for password hashing (never store plaintext passwords)\n- OAuth 2.0 provider credentials for third-party auth integration (Google, GitHub, Auth0)\n\n## Instructions\n\n1. Examine existing authentication setup using Grep and Read, identifying current auth mechanisms, middleware placement, and any endpoints bypassing authentication.\n2. Implement JWT token issuance on successful login: sign with RS256 (asymmetric) or HS256 (symmetric), including `sub` (user ID), `iat`, `exp` (15-minute access token), `roles`, and `scopes` in the payload.\n3. Create authentication middleware that extracts the Bearer token from the `Authorization` header, verifies the signature and expiration, and injects the decoded user context into the request object.\n4. Implement refresh token rotation: issue a long-lived refresh token (30 days) alongside the access token, store a hash of the refresh token in the database, and rotate on each refresh (invalidating the previous token).\n5. Build role-based access control (RBAC) middleware that checks `user.roles` against endpoint-required roles, supporting both role-level (`admin`, `user`) and scope-level (`read:users`, `write:orders`) authorization.\n6. Add API key authentication as an alternative to JWT for machine-to-machine communication: generate cryptographically random keys, store hashed values, and validate against the `X-API-Key` header.\n7. Implement OAuth 2.0 client credentials flow for service-to-service authentication, with token caching and automatic renewal before expiration.\n8. Add brute-force protection on login endpoints: rate limit to 5 attempts per minute per IP, implement progressive lockout (15 min, 1 hour) after repeated failures, and log all authentication attempts.\n9. Write security tests covering: valid\u002Finvalid\u002Fexpired tokens, refresh token rotation, role enforcement, API key validation, brute-force lockout, and token revocation.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fimplementation.md` for the full implementation guide.\n\n## Output\n\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Fjwt.js` - JWT token issuance, verification, and refresh logic\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Fmiddleware.js` - Bearer token authentication middleware\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Frbac.js` - Role-based and scope-based access control middleware\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Fapi-keys.js` - API key generation, hashing, and validation\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Fauth\u002Foauth.js` - OAuth 2.0 flow implementations\n- `${CLAUDE_SKILL_DIR}\u002Fsrc\u002Froutes\u002Fauth.js` - Login, register, refresh, and logout endpoints\n- `${CLAUDE_SKILL_DIR}\u002Ftests\u002Fauth\u002F` - Authentication and authorization security tests\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| 401 Token Expired | JWT `exp` claim is in the past | Client should attempt token refresh; if refresh fails, redirect to login |\n| 401 Invalid Signature | JWT signed with different key or tampered payload | Verify signing key matches between issuance and validation; check for key rotation issues |\n| 403 Insufficient Scope | Authenticated user lacks required role\u002Fscope for endpoint | Return required scope in error body; log authorization failure with user and endpoint details |\n| Refresh token reuse | Previously rotated refresh token used (possible token theft) | Invalidate all user sessions immediately; alert user of potential compromise; require re-authentication |\n| API key leaked | API key exposed in client-side code, logs, or version control | Revoke compromised key immediately; issue replacement; scan for exposure source |\n\nRefer to `${CLAUDE_SKILL_DIR}\u002Freferences\u002Ferrors.md` for comprehensive error patterns.\n\n## Examples\n\n**JWT with refresh rotation**: Login returns `{accessToken (15min), refreshToken (30d)}`; client stores refresh token securely; on 401, client calls `POST \u002Fauth\u002Frefresh` with old refresh token, receives new pair, old refresh token is invalidated.\n\n**Multi-provider OAuth**: Support \"Sign in with Google\" and \"Sign in with GitHub\" using OAuth 2.0 authorization code flow, creating local user accounts on first sign-in and linking subsequent provider connections.\n\n**API key with scoped permissions**: Generate API keys with specific scopes (`read:analytics`, `write:webhooks`), stored as SHA-256 hashes, displayed to the user only once at creation, with key rotation support.\n\nSee `${CLAUDE_SKILL_DIR}\u002Freferences\u002Fexamples.md` for additional examples.\n\n## Resources\n\n- RFC 7519 JSON Web Token (JWT): https:\u002F\u002Ftools.ietf.org\u002Fhtml\u002Frfc7519\n- RFC 6749 OAuth 2.0 Authorization Framework\n- OWASP Authentication Cheat Sheet: https:\u002F\u002Fcheatsheetseries.owasp.org\u002F\n- Auth0 architecture patterns: https:\u002F\u002Fauth0.com\u002Fdocs\u002F",{"name":5,"tags":24,"author":28,"license":15,"version":29,"description":30,"allowed-tools":31,"compatible-with":32},[25,26,27],"api","authentication","api-authentication","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Build secure API authentication systems with OAuth2, JWT, API keys, and session management.\nUse when implementing secure authentication flows.\nTrigger with phrases like \"build authentication\", \"add API auth\", or \"secure the API\".\n","Read, Write, Edit, Grep, Glob, Bash(api:auth-*)","claude-code, codex, openclaw","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fapi-development--api-authentication-builder--building-api-authentication",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill building-api-authentication",{"tool":48,"command":49},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill building-api-authentication",{"tool":51,"command":52},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill building-api-authentication","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fapi-development--api-authentication-builder--building-api-authentication\u002FSKILL.md",true,[],[57,64,71,78,85,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]