• Post Reply Bookmark Topic Watch Topic
  • New Topic

LDAP search in "lower" ou ?

 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need to do a fairly simple search in a directory using javax.naming.directory.InitialDirContext:


What I need to search is structured like this:
cn=<name>+uid=12345, ou=People, ou=Bureau of the Public Debt, ou=Department of the Treasury,o=U.S. Government,c=US

The code always returns "Not found" when executed for a uid known to be present. My question is, can the search be set to recursively descend or must I create a subcontext directly above the cn? Part of the problem is that I need to do a Department-wide search and do not know the bureau necessarily.
 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried creating a SearchControls object:

Still not finding the target. Is the fact that the search target is a partial CN a factor?
 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now finding the target: new code However,
not finding all the attributes. Using an LDAP browser, can see the email attribute of the target, but not able to get it from the program. See code
The email attribute is there, but it does not show up in the log.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!