Introduction to Passport.js and JSON Web Tokens
Explore how to implement user sign-up and login functionalities for an Express API by integrating Passport.js with JSON Web Tokens. Understand the JWT authentication flow and secure protected routes efficiently.
We'll cover the following...
We'll cover the following...
By the end of this chapter, we’ll be able to do the following:
- Implement sign-up and login functionalities for our Express Recipes API.
- Authenticate application users’ requests using Passport.js and JSON Web Tokens.
Passport.js overview
Passport.js is an easy-to-integrate middleware used for authentication.
Passport.js offers various authentication mechanisms (known as strategies) as individually-packaged modules. Currently, more than 500 authentication strategies exist in the Passport.js ecosystem. Strategies include verifying a username and password, delegated authentication using OAuth, and federated authentication using OpenID. ...