auth-implementation-patterns — Claude skill: JWT, OAuth2, RBAC
A skill for designing authentication and authorization: JWT, OAuth2, sessions, roles. Useful when you build a login flow or fix an access bug.
/plugin marketplace add wshobson/agents
/plugin install developer-essentials@claude-code-workflowsWhat auth-implementation-patterns does
The skill lays out how authentication and authorization differ. AuthN answers who you are: verifying identity, issuing sessions and tokens, handling login and logout. AuthZ answers what you may do: permission checks, roles, resource ownership.
Three approaches get covered: server-side sessions with an ID in a cookie, stateless JWT tokens, and OAuth2 with OpenID Connect for Google or GitHub login and enterprise SSO. There is also a list of common mistakes — unhashed passwords, JWT in localStorage, tokens that never expire, permission checks that live only on the client. Worked examples sit in references/details.md, which you read when the short version is not enough.
Worth installing if you are building auth from scratch or replacing an old access scheme. If login already works and your problem is elsewhere, this skill adds nothing.
What it helps with
- design a login flow on JWT or server sessions
- add Google or GitHub sign-in through OAuth2
- split roles and permissions across an API
- lock down a REST or GraphQL endpoint
- track down why a token or session misbehaves
Example prompts for the agent
- help me design authentication for a REST API with JWT
- add GitHub OAuth2 login to this project
- review my RBAC setup and point out the gaps
How to install auth-implementation-patterns
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install developer-essentials@claude-code-workflowsThis installs the whole developer-essentials plugin with all its skills
2Skills CLI (Vercel)
npx skills add wshobson/agents --skill auth-implementation-patterns -a claude-code3Manually: put the files in place
~/.claude/skills/auth-implementation-patterns/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/auth-implementation-patterns/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill auth-implementation-patterns -a codex2Manually: put the files in place
.agents/skills/auth-implementation-patterns/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill auth-implementation-patterns -a cursor2Manually: put the files in place
.cursor/skills/auth-implementation-patterns/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshobson/agents auth-implementation-patterns2Manually: put the files in place
.github/skills/auth-implementation-patterns/SKILL.mdPlatform CLI
gemini skills install https://github.com/wshobson/agents --path plugins/developer-essentials/skills/auth-implementation-patternsManually: put the files in place
.devin/skills/auth-implementation-patterns/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set213
The whole set →Similar
Questions about auth-implementation-patterns
How do I install auth-implementation-patterns in Claude?
Through the plugin marketplace: /plugin marketplace add wshobson/agents, then /plugin install developer-essentials@claude-code-workflows. Or directly: npx skills add wshobson/agents --skill auth-implementation-patterns -a claude-code.
What does auth-implementation-patterns do?
It walks through authentication and authorization patterns: sessions, JWT, OAuth2, RBAC. It helps you pick a scheme and avoid mistakes like storing JWT in localStorage.
Which platforms does the skill support?
Claude, Codex and Cursor. Each platform has its own install command and its own skill directory.
Source text
SKILL.md · MIT
--- name: auth-implementation-patterns description: Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues. --- # Authentication & Authorization Implementation Patterns Build secure, scalable authentication and authorization systems using industry-standard patterns and modern best practices. ## When to Use This Skill - Implementing user authentication systems - Securing REST or GraphQL APIs - Adding OAuth2/social login - Implementing role-based access control (RBAC) - Designing session management - Migrating authentication systems - Debugging auth issues - Implementing SSO or multi-tenancy ## Core Concepts ### 1. Authentication vs Authorization **Authentication (AuthN)**: Who are you? - Verifying identity (username/password, OAuth, biometrics) - Issuing credentials (sessions, tokens) - Managing login/logout **Authorization (AuthZ)**: What can you do? - Permission checking - Role-based access control (RBAC) - Resource ownership validation - Policy enforcement ### 2. Authentication Strategies **Session-Based:** - Server stores session state - Session ID in cookie - Traditional, simple, stateful **Token-Based (JWT):** - Stateless, self-contained - Scales horizontally - Can store claims **OAuth2/OpenID Connect:** - Delegate authentication - Social login (Google, GitHub) - Enterprise SSO ## Detailed patterns and worked examples Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient. ## Best Practices 1. **Never Store Plain Passwords**: Always hash with bcrypt/argon2 2. **Use HTTPS**: Encrypt data in transit 3. **Short-Lived Access Tokens**: 15-30 minutes max 4. **Secure Cookies**: httpOnly, secure, sameSite flags 5. **Validate All Input**: Email format, password strength 6. **Rate Limit Auth Endpoints**: Prevent brute force attacks 7. **Implement CSRF Protection**: For session-based auth 8. **Rotate Secrets Regularly**: JWT secrets, session secrets 9. **Log Security Events**: Login attempts, failed auth 10. **Use MFA When Possible**: Extra security layer ## Common Pitfalls - **Weak Passwords**: Enforce strong password policies - **JWT in localStorage**: Vulnerable to XSS, use httpOnly cookies - **No Token Expiration**: Tokens should expire - **Client-Side Auth Checks Only**: Always validate server-side - **Insecure Password Reset**: Use secure tokens with expiration - **No Rate Limiting**: Vulnerable to brute force - **Trusting Client Data**: Always validate on server
© Seth Hobson · MIT · wshobson/agents