auth-patterns

Implement JWT, OAuth/OIDC, session, and RBAC/ABAC authentication patterns.

14|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rnavarych/alpha-engineer --skill auth-patterns-rnavarych
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-patterns
Source: https://github.com/rnavarych/alpha-engineer/tree/main/plugins/billy-milligan/skills/development/auth-patterns
Command: npx skills add https://github.com/rnavarych/alpha-engineer --skill auth-patterns-rnavarych

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides robust and secure authentication patterns to protect user accounts and data from common vulnerabilities like enumeration, session hijacking, and unauthorized access.

Core Features & Use Cases

  • Secure Token Management: Implements JWT and session-based authentication with rotation and revocation.
  • Vulnerability Mitigation: Addresses timing attacks, CSRF, and session fixation.
  • Multi-Tenancy: Offers strategies for isolating data and access control in multi-tenant applications.
  • Use Case: Securely authenticate users in a web application, ensuring that access tokens are short-lived, refresh tokens are rotated, and user sessions are protected against common web security threats.

Quick Start

Implement JWT-based authentication with short-lived access tokens and rotating refresh tokens.

Frequently Asked Questions about auth-patterns

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

FAQPage Schema
How do I implement secure JWT authentication with token rotation?

Secure JWT authentication requires short-lived access tokens and rotating refresh tokens to prevent session hijacking. This pattern mitigates unauthorized access by ensuring stolen tokens expire quickly and are invalidated upon refresh.

What is the best way to prevent user enumeration and timing attacks during authentication?

Preventing user enumeration and timing attacks requires consistent response times and generic error messages during login and password recovery. This approach protects user accounts by masking whether a specific username exists in the system.

How do I implement multi-tenant authentication and data isolation?

Multi-tenant authentication and data isolation can be implemented using schema-per-tenant or database-per-tenant strategies. These approaches ensure strict access control and prevent data leakage between tenants.

Does this approach support both OAuth and session-based authentication?

Yes, secure authentication patterns support both OAuth/OIDC and session-based authentication. This includes implementing session management with rotation and revocation alongside CSRF protection and session fixation mitigation.

When should I use RBAC versus ABAC for access control?

RBAC assigns permissions based on predefined roles, while ABAC evaluates attributes and context for dynamic access decisions. Both methods are supported to build resilient authorization systems tailored to your application's security requirements.

How do I protect web application sessions from CSRF and session fixation?

Protecting web sessions from CSRF and session fixation involves implementing token validation and regenerating session IDs upon authentication. These patterns secure user sessions against common web security threats and unauthorized access.