passport-jwt-nestjs

Implement JWT authentication with password hashing and role-based authorization in NestJS.

3|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/ai-enhanced-engineer/aiee-skills --skill passport-jwt-nestjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: passport-jwt-nestjs
Source: https://github.com/ai-enhanced-engineer/aiee-skills/tree/main/skills/passport-jwt-nestjs
Command: npx skills add https://github.com/ai-enhanced-engineer/aiee-skills --skill passport-jwt-nestjs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @nestjs/passport, passport-jwt, bcrypt, @nestjs/jwt, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a comprehensive solution for JWT authentication in NestJS, addressing password hashing, token issuance, refresh-token rotation, and role-based authorization.

Core Features & Use Cases

  • JWT Authentication: Securely authenticate users with JSON Web Tokens.
  • Password Hashing: Safely store and verify user passwords with bcrypt.
  • Refresh-Token Rotation: Implement refresh-token rotation for long-term sessions.
  • Role-Based Authorization: Enforce role-based access control.
  • Use Case: Ideal for NestJS applications requiring robust authentication and authorization mechanisms.

Quick Start

Install the skill and use the provided configuration to set up JWT authentication in your NestJS application.

Frequently Asked Questions about passport-jwt-nestjs

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

FAQPage Schema
How do I implement JWT authentication in NestJS with passport?

Implementing JWT authentication in NestJS requires strategies for password hashing, token issuance, and role-based authorization. This process utilizes @nestjs/passport and passport-jwt to securely authenticate users via JSON Web Tokens.

What's the best way to set up bcrypt password hashing in a NestJS application?

Setting up bcrypt password hashing in NestJS involves securely storing and verifying user passwords. This Skill provides built-in strategies to safely hash passwords using the bcrypt library within your authentication workflow.

Can I implement refresh-token rotation for long-term sessions in NestJS?

Yes, you can implement refresh-token rotation for long-term sessions in NestJS. This Skill provides the necessary logic to handle token rotation, ensuring users maintain secure, persistent authentication without repeatedly logging in.

Does this NestJS authentication approach support role-based authorization?

Yes, this NestJS authentication approach supports role-based authorization. It provides specific strategies to enforce role-based access control, allowing you to restrict resources based on assigned user roles.

What dependencies do I need for secure JWT and passport integration in NestJS?

Secure JWT and passport integration in NestJS requires four main dependencies: @nestjs/passport, passport-jwt, bcrypt, and @nestjs/jwt. These libraries provide the foundational modules for token generation and password verification.