Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Using Active Directory with java

  • 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