Skip to main content
skill Claude Code CX Codex Cursor

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.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install developer-essentials@claude-code-workflows
Open on GitHub

What 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-workflows

This installs the whole developer-essentials plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill auth-implementation-patterns -a claude-code

3Manually: put the files in place

~/.claude/skills/auth-implementation-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/auth-implementation-patterns/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

detection-engineering-coverage-evaluation official google This skill checks Google SecOps rule coverage against synthetic events generated from threat intelligence. Use it to find detection gaps and prepare rules to address them. Claude Code Gemini CLI CX Codex 6,394installs google-cloud-recipe-foundation-builder official google Sets up a baseline landing zone for a Google Cloud Organization, including security policies, folders, projects, billing, and centralized logs. Use it when establishing a new organization foundation, not when onboarding one project. Claude Code Gemini CLI CX Codex 6,337installs data-manager-api-setup official google This skill sets up Data Manager API access and client libraries. Use it when preparing a local environment before building an API integration. Claude Code Gemini CLI CX Codex 6,109installs google-cloud-solution-architecture official google This skill gathers requirements and designs complex Google Cloud systems. Use it for new cloud workloads, migrations, and multi-product architecture work. Claude Code Gemini CLI CX Codex 5,980installs unlazy Leonxlnx This skill sets testable completion gates, breaks complex work into stages, and rechecks evidence before the agent reports completion. Claude Code CX Codex Cursor +1 9,400installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. Claude Code 499,069installs ponytail-review DietrichGebert ponytail-review reviews a change beyond the diff, checking connected code, bugs, risks, load, tests, speed, and unnecessary code. Use it for PRs and commits. Claude Code CX Codex Cursor +1 56,300installs ponytail-audit DietrichGebert It audits a repository and ranks bugs, risks, and redundant code in a one-shot report. Use it when you need a review without code changes. Claude Code CX Codex Cursor +1 44,800installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor