Auth Middleware Builder
VerifiedGenerates authentication and authorization middleware for Node.js, Python, and Go APIs with JWT, API keys, and RBAC.
Install
Claude Code
Copy the SKILL.md file to your project's .claude/skills/ directory About This Skill
Auth Middleware Builder generates secure, production-tested authentication and authorization patterns for REST APIs. It understands the security implications of every decision and generates code that is both correct and auditable.
Authentication Strategies
JWT Bearer Authentication - Token validation with proper algorithm pinning (RS256 or HS256) - Claims extraction and type-safe request enrichment - Token expiration and refresh handling - Revocation support via token denylist (Redis)
API Key Authentication - Hashed key storage (never store plaintext API keys) - Key prefix for identification without exposing the secret - Per-key metadata: owner, scopes, expiration, rate limit tier
OAuth2 / OIDC - Token introspection against authorization server - JWT signature verification using JWKS endpoint - Scope-based access control
Authorization Patterns
Role-Based Access Control (RBAC) ``` roles: ["admin", "editor", "viewer"] permissions: { "posts:write": ["admin", "editor"], "posts:read": ["viewer"] } ```
Attribute-Based Access Control (ABAC) Policy evaluation functions for complex resource ownership checks.
Framework Support
- Express.js — middleware functions and error handlers
- Fastify — hooks and decorators
- FastAPI — dependency injection pattern
- Echo (Go) — middleware groups
Security Defaults
All generated code defaults to secure settings: strict algorithm validation, short JWT expiry, HttpOnly cookie flag for web apps, and constant-time comparison for secrets.
Use Cases
- Adding JWT-based authentication to existing Express or FastAPI applications
- Implementing role-based access control (RBAC) for multi-tenant APIs
- Generating API key authentication with rate limiting integration
- Creating middleware chains for request validation and logging
Pros & Cons
Pros
- + Security-first defaults — no insecure patterns generated
- + Supports JWT, API keys, and OAuth2/OIDC in one skill
- + RBAC and ABAC patterns for complex authorization
- + Works across Express, Fastify, FastAPI, and Go Echo
Cons
- - Generated auth code must be reviewed by a security-aware developer before production deployment
- - OAuth2 flows require additional configuration of the authorization server
Related AI Tools
Claude Code
Paid
Anthropic's agentic CLI for autonomous terminal-native coding workflows
- Terminal-native autonomous coding agent
- Full file system and shell access for multi-step tasks
- Deep codebase understanding via repository indexing
Cursor
Freemium
AI-native code editor with deep multi-model integration and agentic coding
- AI-native Cmd+K inline editing and generation
- Composer Agent for autonomous multi-file changes
- Full codebase indexing and context awareness
GitHub Copilot
Freemium
AI pair programmer that suggests code in real time across your IDE
- Real-time code completions across 30+ languages
- Copilot Chat for natural language code Q&A
- Pull request description and summary generation
Related Skills
JWT Validator
VerifiedImplements secure JWT creation, validation, and rotation with proper algorithm selection, claim validation, and key management.
OAuth Implementer
VerifiedImplements OAuth 2.0 and OIDC flows (authorization code, PKCE, client credentials) with provider-specific configurations for Google, GitHub, and more.
Stay Updated on Agent Skills
Get weekly curated skills + safety alerts
每周精选 Skills + 安全预警