我有一个远程LDAP服务器,其条目如下:
CN=Fred Foobar, OU=Dept1, O=FooBar使用LDAPjs作为客户端,在运行时只知道CN时,如何找到这个条目?
我试过以下每一种方法,但都没有成功:
ldap.search("cn=Fred Foobar", {}, callback); // returns an error
ldap.search("", {filter: "(cn=Fred Foobar)"}, callback); // returns nothing useful
ldap.search("", {filter: "(cn=Fred Foobar)", scope: "sub"}, callback); // returns an error发布于 2017-06-01 06:59:30
我从未使用过ldapjs,但是从文档中我会尝试:
ldap.search("O=FooBar", {scope:"sub", filter:"(cn=Fred Foobar)"},function(err, res) {
// Code to handle the result
});见doc:http://ldapjs.org/client.html#search
https://stackoverflow.com/questions/44293007
复制相似问题