I'm setting up Passport to authenticate via LDAP (using passport-ldap
) and whenever a user fails to log in, it successfully loads my failureDirect
link. However, if I do log in successfully (or so I think) the program just hangs. There aren't any errors received; my browser just seems like it's loading ("waiting for server..."). Is there any way to see exactly where Passport is freezing without going through the entire trace of functions that are called and putting a console.log
statement in each function?
in my routes:
app.post('/users/session',
passport.authenticate('ldap', {
failureRedirect: '/login_fail',
successRedirect: '/admin'
}), users.session)
in my passport.js
file:
var LDAPStrategy = require('passport-ldap').Strategy
[...]
passport.use(new LDAPStrategy({
server:{
url: 'ldap://[MY_URL]:3268',
},
base: '[HIDDEN]',
search: {
filter: "(&(objectclass=user)(sAMAccountname={{username}}))",
}
},
function(user, done) {
console.log("Success")
return done(null, JSON.parse(user));
}
))