Chapter 7. Building OAuth Strategies with passport.js
In the preceding chapter, we discussed the passport-JWT strategy. We discussed how to leverage the JWT package to build a robust user on-boarding process. We covered how to implement the signup and sign-in process for a user. In this chapter, we will dive into the following parts:
passport.js
Facebook Strategypassport.js
Twitter Strategypassport.js
Google Strategypassport.js
LinkedIn Strategy
All these parts individually consume a lot of time if we set out to do them from scratch. passport.js
provides a simpler way to integrate all these strategies in a very flexible way, and also makes them easier to implement.
OAuth is an authentication protocol that lets users log in via different external services. For example, logging in to an application via Facebook or Twitter does not require a user to provide their username and password if the user is already logged in to Facebook or Twitter. It saves the user from setting up a new account in an application...