Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Using Active Directory with java

Options
  • 03-06-2005 12:12pm
    #1
    Closed Accounts Posts: 1,525 ✭✭✭


    Just wondering if anyone has any experience with using ADS through java. I can connect to the server with a LDAP connection. The fact that I can connect effectively means that I am authenticated. However I'm stumped as regards authorisation. What exactly am I supposed to look up to determine if the user is in a group? The code I'm trying so far is below. Any help is greatly appreciated.

    DirContext ctx = null;

    try {

    ctx =
    new InitialDirContext(env); // env is correctly set up

    System.out.println("bind Successful...");

    // what next ?????


    ctx.close();

    }
    catch (AuthenticationException aex) {

    // Authentication exception indicates that the request contained and invalid password

    System.out.println("Login failed...Invalid Password.");

    }
    catch (javax.naming.NamingException nex) {

    // Naming exception indicates that the request contained an invalid Corporate ID

    nex.printStackTrace();

    System.out.println(
    "Login failed...Invalid Corporate ID.");

    }



Comments

  • Closed Accounts Posts: 1,525 ✭✭✭vorbis


    Anyone using java with ADS at all???


Advertisement