LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old October 8th, 2003, 05:28 AM
winston_pinto winston_pinto is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 winston_pinto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Active Directory Services using Java API

Hello All,

I want to know whether its possible to connect to Active Directory Services through Java and able to retreive the users and groups from Active Directory Services. If its possible can i get the code.

thanks
Winston

Reply With Quote
  #2  
Old January 5th, 2004, 05:07 AM
antheo antheo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 2 antheo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
any answer ?

did you get any solution ?

I am interested too.

Thanks.

Antheo.

Reply With Quote
  #3  
Old January 5th, 2004, 06:57 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,620 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 4 Days 2 h 52 m 26 sec
Reputation Power: 259
AD exposes an LDAP interface, so it could be possible to connect to like any other LDAP server.
On Sourceforge there is a specific taglib, other material on OpenLDAP.

Reply With Quote
  #4  
Old January 12th, 2004, 04:13 AM
Shift244 Shift244 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 3 Shift244 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i searched on sourceforge and openldap regarding the ldap interface for active directory.

i found nothing on sourceforge... and the only link from openldap was to novell. i've been trying to get it for sometime, but novell does not allow download accelerators nor continuation applications (it seems) and i've been "timed out" way too many times, that frustration has built up.

i would like pabloj to be more specific in his post, or maybe provide a link as to where his two direction is? or if novell is correct and worth me trying to get it downloaded, as i've gotten the netscape ldap sdk only find it is specifically for developing with netscape (it seems..)

please? thx

Last edited by Shift244 : January 12th, 2004 at 04:19 AM.

Reply With Quote
  #5  
Old January 12th, 2004, 04:17 AM
antheo antheo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 2 antheo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I succeedeed connecting to AD by using the jndi tutorial from Sun.
Take a look at it.

Reply With Quote
  #6  
Old January 12th, 2004, 06:59 PM
Shift244 Shift244 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 3 Shift244 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thx antheo! found the stuff and looks workable.. trying it out!

Reply With Quote
  #7  
Old January 18th, 2004, 08:52 PM
Shift244 Shift244 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 3 Shift244 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

i've run into problems again. i've created a user account "john doe", and did not place it into any groups. right now, i keep gettting:
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 525, v893

there is some sort of authentication problem here. i'm using the following:

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://"+ addressort+"/dc=domain,dc=name,dc=com");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "cn=john doe,dc=domain,dc=name,dc=com");
env.put(Context.SECURITY_CREDENTIALS, password);

i've also tried with "ou=user" after "cn=doe" to no avail. i'm connecting to win2k server with service pack 3 installed, and i can get a connection using LDAPbrowser (from Jarek Gawor) using the same values.

Reply With Quote
  #8  
Old May 5th, 2004, 05:52 AM
vista76 vista76 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 vista76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by antheo
I succeedeed connecting to AD by using the jndi tutorial from Sun.
Take a look at it.

Hello,

Can you please send me the code to connect to AD using JNDI.

Also, please let me know which jar file needs to be put in the classpath.

Thanks in advance.
Andy

Reply With Quote
  #10  
Old May 7th, 2004, 08:00 AM
hopstream's Avatar
hopstream hopstream is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 187 hopstream User rank is Private First Class (20 - 50 Reputation Level)hopstream User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 9 m 30 sec
Reputation Power: 6
Thanks guys, I was looking for a solution to a similar problem.
__________________

Saving money is easy with discount codes from under tag coupons. Coupon codes for online purchases.

Reply With Quote
  #11  
Old June 11th, 2004, 11:48 PM
nemath nemath is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 nemath User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Java code to connect o active directory

Hello,

Can nayone please send me the code to connect to AD using java code .

Also, please let me know which jar file needs to be put in the classpath.

Thanks in advance.
Alvi

Reply With Quote
  #12  
Old June 12th, 2004, 12:34 AM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Psycho Canadian
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jan 2001
Location: Canada
Posts: 4,780 Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 4 Weeks 16 h 43 m 4 sec
Reputation Power: 419
Nemath you should start a new thread makes it alot easier to find your post.
__________________
Miscellaneous Software
Viper_SB
Developershed E-Support


Anyone else play chess?
Challenge me

Reply With Quote
  #13  
Old October 8th, 2004, 06:07 AM
kiransonaje kiransonaje is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 kiransonaje User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,



import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
class DomainCon
{
public static void main(String args[])
{
Hashtable env= new Hashtable(11);
env.put(Context.SECURITY_AUTHENTICATION,"none");
env.put(Context.SECURITY_PRINCIPAL,"CN=kiran,OU=LinkedgeOU,DC=LINKEDGEDOMAIN");//User
env.put(Context.SECURITY_CREDENTIALS, "kiran");//Password
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,"ldap://testing2:389/DC=LINKEDGEDOMAIN");
try
{
DirContext ctx = new InitialDirContext(env);
String[] sAttrIDs = new String[2];

Attributes attr = ctx.getAttributes("");
System.out.println("Domain Name:"+ attr.get("name").get());
}
catch(NamingException e)
{
System.err.println("Problem getting attribute: " + e);
}
}
}

This java code will help you ou to connect with active directory

Reply With Quote
  #14  
Old April 4th, 2005, 04:47 AM
Sathish Jo Sathish Jo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 1 Sathish Jo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 25 sec
Reputation Power: 0
ADS Access

Winston..
Please read this article .
http://forum.java.sun.com/thread.jspa?threadID=581444&messageID=3313188



Quote:
Originally Posted by winston_pinto
Hello All,

I want to know whether its possible to connect to Active Directory Services through Java and able to retreive the users and groups from Active Directory Services. If its possible can i get the code.

thanks
Winston

Reply With Quote
  #15  
Old March 11th, 2008, 07:00 AM
bharat_gr8 bharat_gr8 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 4 bharat_gr8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 sec
Reputation Power: 0
Hello

Quote:
Originally Posted by antheo
I succeedeed connecting to AD by using the jndi tutorial from Sun.
Take a look at it.


Hello,
This is Bharadwaj. can you please guide me, where you found the tutorial for connecting to Active Directory using JAVA programming. Can you please gimme the exact link for that tutorial. I need to finish this task given by my PM urgently.
Please help me.

Thank You

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > Active Directory Services using Java API


Thread Tools  Search this Thread