Closed harshasrisri closed 3 years ago
You won't find any entries named displayName=...,...
if their names are of the form cn=...,...
. Your search should use the bare base_dn
, Scope::Subtree
and displayName=...
as the filter.
This is brilliant! Again, can't thank you enough for this library. You're helping me learn LDAP :-) I have one more pressing question and I'll open another issue for it.
Hi, I got my search working on an LDAP connection using a CN with this code:
The problem in the LDAP server is that the CN is not in a consistent format for all users. For example, it is a username in some cases, while it is a full name for others. So, I want to search with a more predictable attribute, like
displayName
,email
, "givenName" or "sn".However, modifying the
query
in the above code to use anything but theCN
like this is throwing an error:Error:
Does the search query has to be on CN?