As we all know authentication plays an important role in every site. Here In this blog I am explaining how we will authenticate our site in node.js as a backend and mongoDb as a database. To authenticate I am using passport.js which will help to login with facebook,twitter and google etc.
In this article I am explaining local authentication with a mongoDb backend.
Prerequisites:
Install node.js,express.js and mongoDb .For installing them please read my previous blog.
when all installation are completed then we will create a new project using express.
express AuthApp
cd AuthApp
npm install
Next we will install passport module by using below command.
npm install passport
Read full blog Here>> Chapter 3: Authentication using node.js(passport.js) and mongoDb