5

What's the difference between Grant & Passport.js? When should one use Grant over passport.js and vice versa?

If I want to make a social media and track user activities and post them on a news feed, which should I use? Grant or passport.js?

roadtocode
  • 329
  • 5
  • 13

1 Answers1

2

Grant is designed specifically for OAuth, whereas passport is designed for pretty much any authentication method (HTTP Basic, local-auth etc). Before I say any more, I don't have much first-hand experience using grant, but I'm pretty familiar with passport.

Passport is at-least 7x more popular (based on github stars), so if you run into an issue your more likely to not be the only person with that problem using passport. This is somewhat evident on stack overflow, the passport tag has ~2100 questions (just the main tag, let alone passport-local etc), whereas Grant doesn't have a tag (that I could fine) associated with it.

Saying that though - some of the official passport documentation is out of date, but the documentation on google-authentication seems to be correct if that's all your using.

All in all, the choice is really up to you, both are viable options. Jared Hanson (the creator of passport) wrote about some of the reasons to choose passport in this answer (Everyauth vs Passport.js).

Ash
  • 6,483
  • 7
  • 29
  • 37
  • where can I read about 'local-auth'? What is local-auth? What does passport-local do? – roadtocode Mar 28 '16 at 00:08
  • 1
    Passport-local is a 'strategy' for passport that allows authentication with a traditional username & password. _Strategies_ are modules used for authentication, so Google authentication has a strategy, HTTP basic authentication has a strategy and so on. You can find more about passport-local on [Github](https://github.com/jaredhanson/passport-local) or on the main [website](http://passportjs.org/docs/username-password) for passport. – Ash Mar 28 '16 at 00:11
  • Thank you for your help, I appreciate it! :) – roadtocode Mar 28 '16 at 00:25
  • Glad I could help, If you found it useful don't forget it's polite to up-vote the answer or mark it as a solution (if the question is answered). – Ash Mar 28 '16 at 00:29