Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation of usage without LDAP seems to be incorrect #31

Open
sidorares opened this issue Dec 8, 2015 · 1 comment
Open

documentation of usage without LDAP seems to be incorrect #31

sidorares opened this issue Dec 8, 2015 · 1 comment

Comments

@sidorares
Copy link

Hi,

the example in documentation is

passport.use(function(profile, done){
  User.findOrCreate({ waId: profile.id }, function (err, user) {
    done(err, user);
  });
}));

but passport.use() expects name, strategy arguments ( or alternatively strategy, with strategy.name defined ) and otherwise throws exception

Looks like correct example should look like this:

passport.use(new WindowsStrategy({
  integrated: true
  }, function(profile, done){
    User.findOrCreate({ waId: profile.id }, function (err, user) {
      done(err, user);
    });
}));
@cjmyles
Copy link

cjmyles commented May 18, 2017

I was getting the following error when executing the code from the Readme (as per your first example):

"Error: Authentication strategies must have a name"

I solved the issue by providing a name in the passport.use() function, such as:

passport.use('WindowsAuthentication', function(profile, done){

However, I then started receiving a different error:

TypeError: strategy.authenticate is not a function

Following your second example seems to have fixed both errors for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants