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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Using Active Directory with java

  • 03-06-2005 11:12am
    #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