jeremycx / node-LDAP

LDAP binding for node.js
MIT License
221 stars 43 forks source link

Search does not return all attrs #83

Closed yubozhao closed 8 years ago

yubozhao commented 8 years ago

hey @jeremycx

Thank you for the package. It is awesome.

I am currently running into this issue, after a successful search. The result only return [objectClass, uid, loginShell, sn, uidNumber, gidNumber, homeDirectory, givenName, cn, dn] fields. Other fields such as mail are missing.

here is my search func:

    var options = {base: 'dc=com', attrs: '*', filter: '(uid=someID)'};
    client.search(options, function (err, res) {
       console.log(err, res);
    });
jeremycx commented 8 years ago

We're pretty much returning everything the LDAP server returns -- are you sure the missing fields are not ones that require authentication to retrieve?

yubozhao commented 8 years ago

Hey @jeremycx Thanks for the quick reply.

That was my initial reaction as well. I use the same authentication info search same obj in jxexplore(a ldap gui for mac) to test and compare. It returns more fields than my method call.

That is why I messaged you

jeremycx commented 8 years ago

It may be that there's a LDAP packet coming back that I'm ignoring or not handling properly with the "missing" attributes in it, but if that's the case it's going to be a heck of a job finding it.

More likely, there's a bug in the auth code so you're not authenticated when you think you are.

Let's try an experiment: let's see if you can get jxexplorer (or ldapsearch on the command line) to return only the partial attributes you are seeing above. Once we find a way to get the same output from a different tool, we will have found the problem.

jeremycx commented 8 years ago

If you can't get any success with the above, please provide a runnable code sample that will exhibit the problem...

yubozhao commented 8 years ago

great thanks.

I will try the jxexplore with search

yubozhao commented 8 years ago

It seems like they are returning different result.

jxexplorer are returning the result, while the method is returning empty array.

I will try to make something runnable code for you

jeremycx commented 8 years ago

Closing due to inactivity.

yubozhao commented 8 years ago

@jeremycx. Yeah. I can't really product runnable code without leaking configs. Sorry.