question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there an equivalent to passport-local on Grant ?

See original GitHub issue

It there an equivalent to passport-local https://github.com/jaredhanson/passport-local that allows Grant to have a local strategy for login ?

passport.use(new LocalStrategy(
  function(username, password, done) {
    User.findOne({ username: username }, function (err, user) {
      if (err) { return done(err); }
      if (!user) { return done(null, false); }
      if (!user.verifyPassword(password)) { return done(null, false); }
      return done(null, user);
    });
  }
));

I am ideally wanting to be able to provide both local login and OAuth2 based login. And want to use Grant as passport is way too cumbersome and badly coded. Grant seems a far far cleaner implementation.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
simovcommented, Jul 19, 2019

Thanks @AaronNGray!

Grant is only concerned with OAuth, and more specifically either OAuth1.0a or the OAuth2.0 authorization_code grant type.

You can use both Grant and some other middleware for user/pass authentication in your app.

2reactions
simovcommented, Jul 20, 2019

OAuth along with OpenID Connect are used for Federated Identity, meaning that the goal is to never let your users enter their passwords directly on your server, but instead delegate that to a third-party Identity Provider.

Grant helps you to easily configure and leverage such provider(s), whether that be a third-party one, or your own, hosted somewhere on your stack. Then you have to make the decision if and how are you going to support password authentication. There are services like Auth0 that supports that out of the box.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passport Alternatives - Authentication - Awesome Node.js
Passport alternatives and similar modules · everyauth · Grant · Truly a developer's best friend · passwordless · Lockit · CloudRail · Popular ......
Read more >
Passport.js alternatives in 2022 : r/node - Reddit
Are there any alternatives to passport.js that aren't such a headache to work with. At this point, I'm almost considering rolling my own...
Read more >
Grant vs Passport.js? [closed] - Stack Overflow
Grant is designed specifically for OAuth, whereas passport is designed for pretty much any authentication method (HTTP Basic, ...
Read more >
Everything you need to know about the `passport-local ...
In this post, I am going to walk through why the passport-local authentication strategy is a simple, secure solution for small teams and ......
Read more >
Vue.js Authentication System with Node.js Backend
passport-local is a library component for Passport.js. It specializes in simple authentication by using the local authentication type. For ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found