auth-implementation-patterns

Implement JWT, OAuth2, session, and RBAC authentication patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/ACGSpgp/ACGS --skill auth-implementation-patterns-acgspgp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-implementation-patterns
Source: https://github.com/ACGSpgp/ACGS/tree/main/.agent/workflows/developer-essentials/1.0.0/skills/auth-implementation-patterns
Command: npx skills add https://github.com/ACGSpgp/ACGS --skill auth-implementation-patterns-acgspgp

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides comprehensive guidance and code examples for implementing robust authentication and authorization mechanisms, ensuring secure and scalable access control for applications.

Core Features & Use Cases

  • Authentication Strategies: Covers session-based, JWT, and OAuth2/OpenID Connect.
  • Authorization Models: Implements Role-Based Access Control (RBAC) and permission-based checks.
  • Security Best Practices: Includes password hashing, rate limiting, and CSRF protection.
  • Use Case: Secure a new web application by implementing JWT-based authentication with refresh tokens and role-based access control for different user tiers.

Quick Start

Implement JWT authentication by generating access and refresh tokens using the provided TypeScript code.

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 authentication with refresh tokens in a web application?

Implement JWT authentication by generating access and refresh tokens using TypeScript. This Skill provides code examples for stateless token-based authentication, covering secure token generation, validation, and refresh workflows using jsonwebtoken.

How does Role-Based Access Control (RBAC) work for API security?

Role-Based Access Control (RBAC) for API security works by enforcing granular permissions based on user roles. This Skill guides you in implementing RBAC models and permission-based checks to restrict access to specific API endpoints and resources.

What's the best way to secure OAuth2 sessions using Passport and Redis?

Secure OAuth2 sessions using Passport and Redis by storing session data with connect-redis. This Skill covers OAuth2/OpenID Connect strategies using passport-google-oauth20 and passport-github2, alongside secure session handling mechanisms.

Can I use bcrypt and zod for password hashing and validation in my auth system?

Yes, you can use bcrypt and zod for password hashing and validation in your auth system. This Skill includes security best practices for password hashing with bcrypt and input validation with zod to ensure robust access control.

How do I apply rate limiting to protect authentication endpoints from abuse?

Apply rate limiting to protect authentication endpoints using express-rate-limit and rate-limit-redis. This Skill provides patterns for integrating Redis-backed rate limiting to prevent brute-force attacks and API security abuse.

When should I use stateless JWT tokens versus session-based authentication?

Use stateless JWT tokens for scalable, decoupled API architectures and session-based authentication for server-rendered web applications requiring immediate session revocation. This Skill covers both strategies, addressing implementation depth and secure session handling.