LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesLDAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 4th, 2012, 12:28 AM
john0088 john0088 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 1 john0088 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 51 sec
Reputation Power: 0
To search user in all OUs present in LDAP via java

hi all;
I am kind of newbie when it comes to LDAP.I am not able to figure out how to search in all organizational units present in my dc
The code I am using to search user is like below


try {
DirContext authContext = new InitialDirContext(env);
try {
Attributes answer = authContext.getAttributes("uid=" + username + "," + basedn, Attributes);
for (NamingEnumeration ae = answer.getAll(); ae.hasMore() {
Attribute attr = (Attribute) ae.next();
NamingEnumeration e = attr.getAll();
String value = "";
while (e.hasMore()) {
value += e.next();
}
map.put(attr.getID(), value);
}
} catch (NamingException e) {
env = null;
Logger.getLogger(AuthenticationAPI.class.getName()).log(Level.SEVERE, null, e);
}




Please Somebody help me if any changes required in this to make user search in all ous ireespective of what is the relative dn by just specifying dc=example,dc=com,

Thnks in advance
John

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > To search user in all OUs present in LDAP via java

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap