Chapter 8: Local Authentication Using Passport in Node.js
by Paul Orac
In the last chapter, we talked about authentication using Passport as it relates to social login (Google, Facebook, GitHub, etc.). In this chapter, we’ll see how we can use Passport for local authentication with a MongoDB back end.
All of the code from this article is available for download on GitHub.
Prerequisites
- Node.js — Download and install Node.js.
- MongoDB — Download and install MongoDB Community Server. Follow the instructions for your OS. Note, if you’re using Ubuntu, this guide can help you get Mongo up and running.
Creating the Project
Once all of the prerequisite software is set up, we can get started.
We’ll begin by creating the folder for our app and then accessing ...
Get 9 Practical Node.js Projects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.