Error: LDAP connection is not yet bound
...
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?
When I try to use
node-ldapauth, I get the following error:My code seems like this:
I am sure that the credentials are valid.
I also tried
cn=sampleinstead ofcn={{username}}but the problem does not resolve.Any idea?