mcavage/node-ldapjs — Issue #33: Client Binding Possible Issue?
Author: rrobe53
Created: 2011-11-08 22:40:34+00:00
State: open

I'm going to start off by saying that I'm not LDAP expert so this may be user error, if so please advise.

I've been using other libraries (https://github.com/jeremycx/node-LDAP) for LDAP authentication but due to various issues with them would like to move away from them. Anyways, the binding in that would allow me to provide the users network login information (which is in the LDAP as sAMAccountName) in a method of binding. I'd pretty much call it like

client.SimpleBind("Username", "Password", function (success) { ... })

Anyways, the bind method here requires me to provide a DN in the first variable, which I'm not sure what to provide. I've tried it without the "DN=" and that doesn't work. The following does not work either.

client.bind('sAMAccountName=Username', 'Password', function(err) {
assert.ifError(err);
});

For what it's worth, using tools like JXplorer I can connect using Username/Password without specifying a DN and it works. When I search for the Username it will bring it up by matching the sAMSAccountName.