Sudeep's Blog

Disorganized Thoughts in Organized Manner

Social logins and passport.js
Creating social logins with passport.js is super-easy. Remember three steps:
  • Configure session middleware (app.use(express.session({ secret: 'keyboard cat' })); etc...)
  • Configure authentication strategies ( passport.use(new TwitterStrategy({ ... }) etc...)
  • Add authentication routes ( app.get('/auth/twitter', passport.authenticate('twitter')); etc.)
Here is a handy tutorial: I found it much better and simpler than passport.js docs. Happy node.jsing!!!
Back to Home