Hello everyone,
I'm trying to get the non-integrated authentication example to work, but I'm still failing.
So i tried some different approaches and found https://www.npmjs.com/package/activedirectory which is working fine for me. Here is the relevant snippet from my activedirectory implementation:
router.post('/', function (req, res) {
console.log('received login request');
var ad = new ActiveDirectory({
url: 'ldap://xxx..xom',
baseDN: 'dc=xxx,dc=com',
username: req.body.username_reader + '@xxx.com', // user allowed to read the AD
password: req.body.password_reader
});
ad.authenticate(req.body.username_login + '@xxx.com', // user to login in
req.body.password_login,
function(err, isAuthenticated) {
if(err) throw err;
if(isAuthenticated) {
console.log('Authenticated!');
} else {
console.log('Failed to authenticate');
}
});
});
This works fine and the username_login user gets authenticated.
Now I'm trying the "same" with passport-windowsauth and I'm failing. There returns no error, but also nothing else ever happens. The app gets lost in the passport.use and function(profile, done) never gets called:
router.post('/', function (req, res) {
console.log('received login request');
passport.use(new WindowsStrategy({
ldap: {
url: 'ldap://xxx.com/dc=xxx,dc=com',
base: 'dc=xxx,dc=com',
bindDN: req.body.username_reader + '@xxx.com',
bindCredentials: req.body.password_reader
},
integrated: false
}, function(profile, done){
console.log('Authenticated!');
}));
});
Where is my mistake, I'm stuck figuring it out on my own ...
Regards,
Michael
Hello everyone,
I'm trying to get the non-integrated authentication example to work, but I'm still failing.
So i tried some different approaches and found https://www.npmjs.com/package/activedirectory which is working fine for me. Here is the relevant snippet from my activedirectory implementation:
This works fine and the username_login user gets authenticated.
Now I'm trying the "same" with passport-windowsauth and I'm failing. There returns no error, but also nothing else ever happens. The app gets lost in the
passport.useandfunction(profile, done)never gets called:Where is my mistake, I'm stuck figuring it out on my own ...
Regards,
Michael