auth-patterns

Implement JWT authentication with refresh token rotation and RBAC enforcement.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/Prathmesh2000/cursor_agent-orchestrator --skill auth-patterns-prathmesh2000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-patterns
Source: https://github.com/Prathmesh2000/cursor_agent-orchestrator/tree/main/agent-system/skills/auth-patterns
Command: npx skills add https://github.com/Prathmesh2000/cursor_agent-orchestrator --skill auth-patterns-prathmesh2000

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implementing secure authentication and authorization across full-stack apps can be error-prone and hard to audit.

Core Features & Use Cases

  • JWT-based authentication with access and refresh tokens, including rotation and HttpOnly cookies.
  • RBAC enforcement and secure session management across backend APIs and frontend UIs.
  • Use Case: Build a protected admin area where only users with the admin role can access sensitive resources.

Quick Start

Integrate the auth-patterns skill to implement a secure login flow with JWTs, refresh tokens, and RBAC across backend and frontend.

Frequently Asked Questions about auth-patterns

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

FAQPage Schema
How do I implement JWT-based authentication with refresh token rotation?

Implement JWT-based authentication by issuing short-lived access tokens and long-lived refresh tokens, storing them in HttpOnly cookies, and rotating refresh tokens upon each use to maintain secure session management across your full-stack application.

What is the best way to enforce RBAC authorization across backend APIs and frontend UIs?

The best way to enforce RBAC authorization is to map user roles to access policies, verifying permissions on both backend API endpoints and frontend UI routes to restrict sensitive resources to authorized roles like admin.

How does token revocation work with stateless JWT sessions?

Token revocation with stateless JWT sessions works by maintaining a server-side denylist or utilizing versioned tokens, allowing the backend to explicitly invalidate active tokens before their expiration time during secure session termination.

Can I use OAuth to secure session management for full-stack applications?

Yes, you can use OAuth to secure session management for full-stack applications by delegating authentication to an external provider, then issuing local JWTs and managing HttpOnly cookies for subsequent API authorization.

Why do I need HttpOnly cookies for secure JWT access tokens?

You need HttpOnly cookies for secure JWT access tokens because they prevent client-side JavaScript from accessing the tokens, mitigating cross-site scripting (XSS) attacks and protecting session integrity across web UIs.