Forked from the supplied boilerplate repository this repo will contain the output of the social authentication challenge on freeCodeCamp.
The basic path this kind of authentication will follow in your app is:
- User clicks a button or link sending them to our route to authenticate using a specific strategy (EG. GitHub)
- Your route calls
passport.authenticate('github')
which redirects them to GitHub.- The page the user lands on, on GitHub, allows them to login if they aren't already. It then asks them to approve access to their profile from our app.
- The user is then returned to our app at a specific callback url with their profile if they are approved.
- They are now authenticated and your app should check if it is a returning profile, or save it in your database if it is not.
You'll need an .env
file with:
GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET
MONGO_URI
SESSION_SECRET
The rest is pretty straightforward, with npm
for package management and nodemon
for development server. Use npm run dev
for starting up the local server.
- PassportJS
- PugJS
- Github OAuth for web applications
- MongoDB