auth-implementation-patterns

Design authentication and authorization patterns for REST/GraphQL APIs with JWT and OAuth2.

3|1|Updated Nov 5, 2025
One-click install
npx skills add https://github.com/carlopezzuto/agents --skill auth-implementation-patterns-carlopezzuto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-implementation-patterns
Source: https://github.com/carlopezzuto/agents/tree/main/.claude/skills/auth-implementation-patterns
Command: npx skills add https://github.com/carlopezzuto/agents --skill auth-implementation-patterns-carlopezzuto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jsonwebtoken, bcrypt, passport, passport-google-oauth20, passport-github2, express-rate-limit, rate-limit-redis, connect-redis, redis, zod, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Design and implement secure authentication and authorization patterns for modern applications, including JWT, OAuth2, session management, and RBAC.

Core Features & Use Cases

  • JWT lifecycle management with access and refresh tokens for stateless APIs.
  • OAuth2/OpenID Connect flows, social login, and SSO integration.
  • RBAC and permission-based access controls with clear separation of concerns.

Quick Start

Configure your API to issue short-lived JWTs on login and validate them on protected routes.

Frequently Asked Questions about auth-implementation-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT access and refresh tokens for a stateless REST API?

JWT lifecycle management for stateless APIs involves issuing short-lived access tokens on login and validating them on protected routes, using refresh tokens to maintain secure sessions, ensuring scalable authentication.

What is the best way to add OAuth2 social login with Passport to an Express app?

OAuth2 social login integration uses Passport strategies like passport-google-oauth20 and passport-github2 to handle authentication flows, enabling single sign-on (SSO) and secure delegation without managing provider credentials directly.

How does RBAC permission-based access control work for microservices?

RBAC permission-based access control for microservices enforces security boundaries by mapping user roles to specific permissions, ensuring clear separation of concerns and validating authorization rights on protected API routes.

Can I use Redis with express-rate-limit to secure authentication endpoints?

Yes, Redis integrates with express-rate-limit via rate-limit-redis and connect-redis to provide distributed rate limiting and session storage, preventing brute-force attacks on authentication endpoints across scalable microservice architectures.

Do I need bcrypt and zod to validate user credentials and auth payloads?

Yes, bcrypt securely hashes user passwords before storage, while zod validates and sanitizes incoming authentication payloads, together preventing injection attacks and credential leakage during the OAuth2 or JWT login process.

When should I not use JWT for session management in a SaaS platform?

JWT session management is not recommended when immediate server-side session revocation is required, as stateless tokens remain valid until expiration unless paired with a Redis blacklist.