authentication-authorization-nestjs

Outline JWT authentication and RBAC patterns for NestJS APIs and frontend routes.

1|Updated Jan 2, 2025
One-click install
npx skills add https://github.com/allenlin90/eridu-services --skill authentication-authorization-nestjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication-authorization-nestjs
Source: https://github.com/allenlin90/eridu-services/tree/main/.agent/skills/authentication-authorization-nestjs
Command: npx skills add https://github.com/allenlin90/eridu-services --skill authentication-authorization-nestjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implementing reliable authentication and authorization across the Eridu Services monorepo to secure APIs and frontend routes, enforce permissions, and prevent unauthorized access.

Core Features & Use Cases

  • JWT-based authentication guards and token validation for backend endpoints.
  • Role-based access control (RBAC) to restrict actions and resources by user roles.
  • Frontend integration patterns for protected routes and secure session handling across apps.
  • Guidance for studio-scoped resources and service-to-service authentication.

Quick Start

Configure your NestJS backend to validate JWTs with the eridu auth SDK and protect routes using guards, then apply studio-protected decorators on studio resources.

Frequently Asked Questions about authentication-authorization-nestjs

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

FAQPage Schema
How do I implement JWT authentication and route guards in NestJS?

JWT authentication in NestJS uses guards to validate tokens and protect endpoints. This Skill outlines backend login flows and token validation patterns, applying API guards and secure storage practices across the Eridu Services monorepo.

What is the best way to set up RBAC for resource access control in a NestJS monorepo?

RBAC in a NestJS monorepo restricts actions and resources by user roles. This Skill provides role-based access control patterns to enforce permissions, including studio-scoped resources and service-to-service authentication for secure access.

Can I use this pattern to secure frontend protected routes and manage sessions?

Yes, securing frontend protected routes and managing sessions is supported. This Skill provides frontend integration patterns for session handling and protected routes, aligning with backend JWT validation to secure apps across the monorepo.

Does this approach cover service-to-service authentication and studio-scoped resources?

Yes, this approach covers both service-to-service authentication and studio-scoped resources. It outlines authorization patterns using decorators and guards to protect specific studio resources and secure internal service communication.

How do I handle token validation and error responses for secure login flows in NestJS?

Handling token validation and error responses requires adherence to best practices for token handling. This Skill solves secure login flows by outlining specific patterns for JWT validation and structured error responses in NestJS.