nestjs-auth-rbac

Implement JWT, OAuth2, and role-based access control in NestJS.

2|1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/sadamkhan7679/agent-ops --skill nestjs-auth-rbac
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-auth-rbac
Source: https://github.com/sadamkhan7679/agent-ops/tree/main/content/skills/nestjs-auth-rbac
Command: npx skills add https://github.com/sadamkhan7679/agent-ops --skill nestjs-auth-rbac

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @nestjs/passport, @nestjs/jwt, argon2, passport-google-oauth20, passport-github2, redis, drizzle-orm, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides comprehensive authentication and role-based access control for NestJS applications to manage user permissions effectively.

Core Features & Use Cases

  • JWT Authentication with Refresh Tokens: Implements secure user login and token renewal workflows.
  • Role and Permission Management: Defines flexible role schemas and permission assignments to control access.
  • OAuth2 and Social Login Integration: Supports Google and GitHub login flows for seamless user onboarding.
  • Security Hardening: Includes measures like CSRF protection, brute-force defenses, and password hashing.
  • Multi-tenancy Support: Identifies tenants via subdomains, headers, or JWT claims with data isolation strategies.
  • Resource Ownership Checks: Ensures users can only modify resources they own unless granted privilege.
  • Token Revocation and Rotation: Supports blacklisting, token families, and session invalidation.

Quick Start

Use the nestjs-auth-rbac skill to set up secure, scalable auth with role-based safeguards in your NestJS project.

Frequently Asked Questions about nestjs-auth-rbac

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

FAQPage Schema
How do I set up JWT authentication with role-based access control in NestJS?

Set up JWT authentication and role-based access control in NestJS by defining flexible role schemas and permission assignments. This system supports secure user login, token renewal workflows, and layered protections to control API access effectively.

Can I implement multi-tenant security and data isolation in a NestJS app?

Implement multi-tenant security in a NestJS app by identifying tenants via subdomains, headers, or JWT claims. This approach supports complex user hierarchies and ensures strict data isolation strategies for enterprise-grade backend solutions.

How do I add Google and GitHub OAuth2 social login to a NestJS API?

Add Google and GitHub OAuth2 social login to a NestJS API by integrating dedicated passport strategies. This supports seamless user onboarding alongside existing JWT authentication and role management workflows.

What is the best way to handle token revocation and session invalidation in NestJS?

Handle token revocation and session invalidation in NestJS by using token blacklisting, token families, and refresh token rotation. This ensures compromised tokens are rejected and active sessions can be securely invalidated.

Does this NestJS authentication system support resource ownership checks?

This NestJS authentication system supports resource ownership checks to ensure users can only modify resources they own. Unless explicitly granted privileges, access is denied, adding a crucial layer of protection for your API endpoints.