Select the API and click on create credentials.įill out the form and use the same callback URL on both the form and on your file. Then go to Enable APIs and Services and enable the Google+ API. To get one, head over to and create a new project. Feel free to use any other strategy you prefer, but make sure to check the docs to see how it is configured.īefore continuing, we need a clientID and clientSecret. I’m going to be using the passport-google-oauth20 strategy in this tutorial. We are going to build a simple app which grants the user access to a secret route only if they log in. To get started, we need to install passport from NPM: npm install passport Gives you the ability to implement custom strategies.Provides separate modules for each strategy.Here are six reasons stating why you should use Passport: A strategy must be configured before usage. Each strategy has its own npm package (such as passport-twitter, passport-google-oauth20). What are these strategies? Strategies are used to authenticate requests. Passport is a middleware which implements authentication on Express-based web applications. You just have to remember your OAuth provider’s main account password. OAuth really makes our lives simpler by eliminating the need to remember the password of every account you create on almost any site. Sites like Quora, Medium, AirBnb and many others offer authentication using OAuth. A third party application can use it to access user data from a site (like Google or Twitter) without revealing their password. OAuth (Open Authorization) is an authorization protocol.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |