Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    2
    Rep 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
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    2
    Rep Power
    0

    any answer ?


    did you get any solution ?

    I am interested too.

    Thanks.

    Antheo.
  4. #3
  5. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
    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.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    3
    Rep 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.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    2
    Rep Power
    0
    I succeedeed connecting to AD by using the jndi tutorial from Sun.
    Take a look at it.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    3
    Rep Power
    0
    thx antheo! found the stuff and looks workable.. trying it out!
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    3
    Rep 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.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    1
    Rep Power
    0
    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
  16. #9
  17. #10
  18. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    193
    Rep Power
    12
    Thanks guys, I was looking for a solution to a similar problem.

    Saving money is easy with discount codes from Rollback coupons. Coupon codes for online purchases.
  19. #11
  20. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    1
    Rep 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
  21. #12
  22. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    Nemath you should start a new thread makes it alot easier to find your post.
  23. #13
  24. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    1
    Rep 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
  25. #14
  26. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    1
    Rep Power
    0

    ADS Access


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



    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
  27. #15
  28. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    4
    Rep Power
    0

    Hello


    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
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo