Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-31-2005, 07:54 PM   #1
Registered: Apr 2002
Location: Chicago, IL
Distribution: Mandriva 2009.0 PowerPack x86_64
Posts: 150

Rep: Reputation: 15
OpenLDAP rootDN fetch with Java

I am using Java, I am messing around with connecting to an OpenLDAP directory, I was wondering how I can query the directory to find out the rootDN. So that I can be given the server name, username and password, without requiring them to provide the rootDN. In otherwords, the use says "localhost", user is cn=Manager, and password is secret, I would like to make an annonymous connection to the directory on localhost, fetch the rootDN, then make a bound connection dc=my-domain,dc=com, on localhost with cn=Manager,dc=my-domain,dc=com.

I tried doing:
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "ldap://localhost/");
SearchControls contrs = new SearchControls();
NamingEnumeration results ="",
"(|(objectclass=*)(objectclass=ldapsubentry))", null, contrs);
while (results.hasMore())
But all I get is: : null:null:{objectclass=objectClass: top, OpenLDAProotDSE}


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fetchmail doesn't fetch linuxhippy Slackware 7 08-27-2005 08:51 PM
Nessus fetch problem skittlebrau Linux - Software 0 04-23-2005 10:41 AM
fetch package? xpcandrew Linux - Newbie 1 02-01-2005 01:32 AM
a broken package, cannot RE-fetch?! b0uncer Arch 2 09-29-2004 09:23 AM
installing fetch mihailolja Linux - Newbie 1 03-10-2004 08:23 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration