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: http://blog.nodeknockout.com/post/34765538605/getting-started-with-passport. I found it much better and simpler than passport.js docs. Happy node.jsing!!!
Tweet
Back to Home