Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Secure Your API with Authentication and Authorization

via CodeSignal

Overview

Add secure authentication and authorization to your Reading Tracker API. Implement user registration, login with JWT, and role-based access control to protect routes and enable admin-level actions for a production-ready backend.

Syllabus

  • Unit 1: User Registration with Hashing
    • Exploring Secure User Registration
    • Implementing Secure User Registration in NestJS
    • Implementing JWT Strategy and Auth Module
    • Building Auth Service and Controller
  • Unit 2: JWT Login and Token Issuance
    • Observing JWT Login and Token Issuance
    • Adding Login Endpoint to Auth Controller
    • Implementing Login Logic in Auth Service
    • Implementing a User Profile Endpoint
  • Unit 3: Protecting Routes with AuthGuard
    • Observing Route Protection with AuthGuard
    • Applying AuthGuard Decorators to Controllers
    • Creating the "Me" Route with AuthGuard
  • Unit 4: Role-Based Authorization
    • Observing Role-Based Authorization with Guards and Decorators
    • Implementing the @Roles() Decorator
    • Applying AuthGuard and RolesGuard to Controllers
    • Implementing Role-Based Authorization in NestJS

Reviews

Start your review of Secure Your API with Authentication and Authorization

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.