Setting up Passport
Passport is an authentication middleware for node that supports; via plugin; multiple authentication strategies, including Basic Auth, OAuth, and OAuth 2. Passport works by defining a route middleware to be used to authenticate the request.
Let's install Passport:
npm install passport --save
Passport does not include a GitHub strategy; for this we need to install passport-github
; a strategy for authenticating with GitHub using the OAuth 2.0 API:
npm install passport-github --save