auth-implementation-patterns

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

6|2|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/amurata/cc-tools --skill auth-implementation-patterns-amurata
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-implementation-patterns
Source: https://github.com/amurata/cc-tools/tree/main/plugins/developer-essentials/skills/auth-implementation-patterns
Command: npx skills add https://github.com/amurata/cc-tools --skill auth-implementation-patterns-amurata

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 secure and scalable authentication and authorization systems in applications.

Core Features & Use Cases

  • Authentication Strategies: Covers session-based, JWT, and OAuth2/OpenID Connect.
  • Authorization Patterns: Implements Role-Based Access Control (RBAC), permission-based checks, and resource ownership verification.
  • Security Best Practices: Includes password hashing, rate limiting, and secure cookie configurations.
  • Use Case: When building a new web application, use this Skill to quickly implement user registration, login, and role-based access control for different user types (e.g., admin, user).

Quick Start

Implement JWT authentication by following the provided TypeScript middleware example.

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 in my Express application?

JWT authentication can be implemented using the jsonwebtoken library alongside Express middleware to verify tokens and secure routes. This Skill provides TypeScript middleware examples to validate tokens and manage user sessions securely.

What's the best way to set up OAuth2 login with Google and GitHub?

OAuth2 login with Google and GitHub is handled using the passport, passport-google-oauth20, and passport-github2 libraries. This Skill provides implementation patterns to authenticate users via these external providers.

How does role-based access control work for different user types?

Role-Based Access Control (RBAC) restricts access based on user roles like admin or user. This Skill demonstrates how to implement permission-based checks and resource ownership verification to enforce authorization rules.

Can I use Redis for session storage and rate limiting?

Yes, Redis can be used for session storage and rate limiting via the connect-redis and rate-limit-redis libraries. This combination ensures scalable session management and protects against brute force attacks.

What security best practices should I follow for password hashing?

Password hashing should use the bcrypt library to securely salt and hash credentials before storage. This Skill covers this alongside secure cookie configurations and rate limiting to ensure robust application security.