auth-implementation-patterns

Implement JWT, OAuth2, and RBAC authentication with Express middleware.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/kimjuyoung1127/signalcraftWebApp --skill auth-implementation-patterns-kimjuyoung1127
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-implementation-patterns
Source: https://github.com/kimjuyoung1127/signalcraftWebApp/tree/main/.agent/skills/auth-implementation-patterns
Command: npx skills add https://github.com/kimjuyoung1127/signalcraftWebApp --skill auth-implementation-patterns-kimjuyoung1127

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps you implement secure authentication and authorization across applications, reducing complexity and risk in access control.

Core Features & Use Cases

  • JWT-based authentication and token management (access and refresh tokens)
  • OAuth2 / OpenID Connect integration for social and enterprise logins
  • Session-based authentication with RBAC/permissions enforcement
  • Secure API access, multi-tenant setups, and auditing

Quick Start

Begin by wiring the sample JWT middleware into an Express route to protect an endpoint, then extend it with your user model and RBAC checks.

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 token refresh in an Express API?

JWT authentication in Express is implemented by wiring middleware to validate access tokens on protected routes and issuing refresh tokens to manage token lifecycles securely without repeated logins.

What is the best way to set up RBAC permission checks for a multi-tenant application?

RBAC for multi-tenant applications is implemented by defining role hierarchies and enforcing permission checks within middleware, ensuring users only access resources permitted by their assigned roles and tenant boundaries.

How does OAuth2 integration work with Passport.js for social logins?

OAuth2 integration with Passport.js uses authentication strategies to redirect users to external providers, obtain authorization codes, and exchange them for access tokens to validate social or enterprise logins.

When should I use session-based authentication instead of JWT for API security?

Session-based authentication is preferred over JWT when you need server-side session invalidation and centralized session tracking, whereas JWT is better for stateless API security across distributed systems.

Can I enforce secure API access and auditing using these authentication patterns?

Secure API access and auditing are enforced by combining RBAC middleware with token validation to restrict endpoints and logging authentication events to track access control changes and user activity.

Are there limitations to using Passport.js for scalable access control?

Passport.js handles authentication strategy orchestration but requires custom middleware layers for complex scalable access control, as it does not natively manage RBAC enforcement or token lifecycle logic.