Hello and welcome computer geeks. In this post we are going to to learn how to add google authentication in node JS application. We will be going to use Passport JS. So letโs get started.
Requirements
There are two things required to add Google authentication in node JS project. The first thing is OAuth 2.0 client ID and client secret. The second thing is Passport JS npm package. So lets first generate OAuth 2.0 client ID and client secret.
How to generate Client ID & Client Secret
In order to generate them you have to go to this link and follow the below steps.
- Click on Create Credentials -> OAuth Client ID.
- Select Application type as Web Application.
- In redirection URL add http://localhost:3000/auth/google/callback
- Click on Create Button and itโs done.
Read Complete Tutorial and Download Codes from here
Top comments (0)