Securing Node.js Apps with JWTs

What is JWT (JSON Web Tokens)?

  • What it is all about
  • What problems does it aims to solve
  • The Structure of the JWT Token

When to use JWT

  • Talk about the scenarios where JSON Web Tokens are useful

Prerequisites

  • List the requirements that must be met to start the tutorial

Create a new Project

  • Demonstrate how to create a node.js project

Install Dependencies

  • Show the dependencies required and how to install them.

Create Server

  • Demonstrate how to create and run a node.js server.

Create Env File

  • Explain what .env is
  • Add the JWT secrets to the .env file

Create App Routes

  • Create some basic express.js routes that return a response that is accessible to all users

Create Auth route

  • Create a route to generate an authorization token for users.

Verify Token Middleware

  • Create a middleware function to verify the user's token.
  • Protect the public routes with this middleware

Test Application

  • Use Postman to test the application

Conclusion

  • Summerize some of the key points covered in the tutorial.
  • Point readers to additional resources
Select a repo