auth0 / passport-windowsauth

Windows Authentication strategy for Passport.js
MIT License
178 stars 54 forks source link

error - Authentication Strategies must have a name #32

Open lingpri opened 8 years ago

lingpri commented 8 years ago

Hi - I'm trying to use this geoservices.js library with my locally hosted ARCGIS geocoding service.This ARCGIS geocoding service is running on IIS Server , with integrated windows authentication. I see credential errors when running against the locally hosted service. Doing some research, it appears, passport-windowsauth.js can help rectify the issue.i followed up with the example provided and am getting the following error. "error - Authentication Strategies must have a name"

  1. I'm running this script in my local machine and connecting to the ARCGIS services hosted in IIS Server.
  2. I made changes in my IIS Server web.config , added a iis user profile : Logon_USER as metioned in the doc.

Please advise , how to go about this. I'm new to node. Do I need to install iisnode on iis server for this to run.

var Geoservices = require('geoservices');
var request = require('request');

var passport = require('passport');
var WindowsStrategy = require('passport-windowsauth');

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

app.get('/express-passport',
  passport.authenticate('WindowsAuthentication'),
  function (req, res){
    res.json(req.user);
  });
jgravois commented 8 years ago

i'm definitely no expert, but the documentation directly below the introduction (here) appears to indicate that you must install iisnode and configure it to pass along a new special variable called LOGON_USER in order to work with the module.

afterwards, they show an express example for passing a username back to someone when they visit your own custom route ie: i go to [http://.../express-passport] and see 'john'

i dont think this allows you to intercept a password or authenticate on behalf of anyone.

gavinr commented 8 years ago

@lingpri does the solution in this issue help you out? https://github.com/auth0/passport-windowsauth/issues/31

cjmyles commented 7 years ago

@gavinr I can't speak for @lingpri but the solution you referenced works for me, and I was encountering the same issue. Although @jgravois' suggestion helps with actually authenticating the user (by enabling the underlying iisnode functionality required by the strategy), it does not solve the strategy name error.

thediveshsoni commented 5 years ago

Still facing the error -> authentication strategies must have a name iisnode is installed and i am passing the variable.

arttobe commented 5 years ago

Did you resolve it? I am running in the same Issue