auth-implementation-patterns

Implement authentication and authorization patterns across TypeScript, Python, and JavaScript frameworks.

2|Updated Mar 15, 2025
One-click install
npx skills add https://github.com/dandudzi/dotfiles --skill auth-implementation-patterns-dandudzi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-implementation-patterns
Source: https://github.com/dandudzi/dotfiles/tree/main/dot_claude/skills/auth-implementation-patterns
Command: npx skills add https://github.com/dandudzi/dotfiles --skill auth-implementation-patterns-dandudzi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides clear guidance and code examples for implementing secure and scalable authentication and authorization strategies in modern applications.

Core Features & Use Cases

  • Auth Strategy Selection: Helps choose between sessions, JWT, and opaque tokens based on application needs.
  • OAuth2/OIDC Implementation: Offers detailed flows (Authorization Code + PKCE, Client Credentials, Device Flow) with code snippets.
  • Session & JWT Management: Covers secure cookie practices, token rotation, and preventing common vulnerabilities.
  • RBAC & Multi-Tenancy: Provides patterns for role-based access control and tenant isolation.
  • Framework Examples: Includes implementations for NextAuth.js and FastAPI.

Quick Start

Implement OAuth2 Authorization Code flow with PKCE for a React SPA.

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 OAuth2 Authorization Code flow with PKCE in a React SPA?

Implement OAuth2 Authorization Code flow with PKCE by leveraging framework-specific integrations like NextAuth.js to manage secure token retrieval and authorization in your React SPA. This Skill provides code snippets for this exact setup.

What is the best way to choose between JWT and opaque session tokens for authentication?

Choosing between JWT and opaque session tokens depends on your application needs regarding state management and scalability. This Skill provides auth strategy selection guidance to help you decide between sessions, JWTs, and opaque tokens based on your specific requirements.

How do I set up role-based access control and multi-tenancy in FastAPI?

Set up role-based access control and multi-tenancy in FastAPI by applying the tenant isolation and access patterns provided. This Skill offers specific framework examples and code implementations for securing multi-tenant applications.

How does token rotation work and how can I prevent common JWT vulnerabilities?

Token rotation works by issuing new tokens while invalidating old ones to prevent session hijacking. This Skill covers secure cookie practices, token rotation strategies, and patterns to prevent common JWT and session management vulnerabilities.

Can I use this guidance for both TypeScript and Python frameworks?

Yes, you can use this guidance for TypeScript, Python, and JavaScript frameworks. It provides comprehensive code examples and patterns for implementing authentication and authorization across these specific language environments.