-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
When I try to use node-ldapauth, I get the following error:
Error: LDAP connection is not yet bound
...
My code seems like this:
var config = {
ldap: {
url: "ldap://1.2.3.4",
adminDn: "cn=admin, dc=sub, dc=domain",
adminPassword: "Secret",
searchBase: "dc=sub, dc=domain",
searchFilter: "(cn={{username}})"
}
};
var auth = new ldap({
url: config.ldap.url,
adminDn: config.ldap.adminDn,
adminPassword: config.ldap.adminPassword,
searchBase: config.ldap.searchBase,
searchFilter: config.ldap.searchFilter
});
auth.authenticate('cn=sample , ou=sub1, ou=sub2, dc=sub, dc=domain', 'samplesecret', function(err, user) {
if (err) {
console.log(err);
res.writeHead('401');
res.end()
} else {
res.writeHead('200');
res.end();
}
});
I am sure that the credentials are valid.
I also tried cn=sample instead of cn={{username}} but the problem does not resolve.
Any idea?
Metadata
Metadata
Assignees
Labels
No labels