I have a OpenLDAP server running locally. When I try to authenticate a user with ldapauth-fork it reports no such user: "my-username" even though the OpenLDAP console reports 1 entry found.
If I manually run the search in Apache Directory Studio with the same arguments that I pass to the LdapAuth constructor, it correctly finds the user.
When I intentionally pass a wrong username (one that doesn't exist in LDAP) to authenticate(), both ldapauth-fork and OpenLDAP will correctly report "no such user" and nentries=0 respectively.
During debugging it seemed like my app never got to this code from ldapauth-fork:
var items = [];
searchResult.on('searchEntry', function (entry) {
items.push(entry.object);
if (self.opts.includeRaw === true) {
items[items.length - 1]._raw = entry.raw;
}
});
When I followed the Debugger all the way down to ldapjs's code it looked like ldapjs did find the entity it was supposed to but somehow that entity never made it back to my code.
I have a OpenLDAP server running locally. When I try to authenticate a user with
ldapauth-fork
it reportsno such user: "my-username"
even though the OpenLDAP console reports 1 entry found.If I manually run the search in Apache Directory Studio with the same arguments that I pass to the
LdapAuth
constructor, it correctly finds the user. When I intentionally pass a wrong username (one that doesn't exist in LDAP) toauthenticate()
, bothldapauth-fork
and OpenLDAP will correctly report "no such user" andnentries=0
respectively.I'm running this image for my local OpenLDAP server. https://hub.docker.com/r/bitnami/openldap/ (tag: 2.6.3)
During debugging it seemed like my app never got to this code from
ldapauth-fork
:When I followed the Debugger all the way down to
ldapjs
's code it looked likeldapjs
did find the entity it was supposed to but somehow that entity never made it back to my code.My code:
I'm certainly not an LDAP expert so it's entirely possible that I'm doing something wrong, I just don't know what.