edu.northwestern.at.utils.net.ldap
Class LdapAuthenticator

java.lang.Object
  extended by edu.northwestern.at.utils.net.ldap.LdapAuthenticator

public class LdapAuthenticator
extends java.lang.Object

Validates user credentials against an LDAP server.


Method Summary
static boolean authenticate(java.lang.String userName, java.lang.String password, java.lang.String ldapURL, java.lang.String ldapPrincipal)
          Validate a username/password pair using an LDAP directory.
static boolean authenticate(java.lang.String userName, java.lang.String password, java.lang.String ldapURL, java.lang.String ldapPrincipal, java.lang.String keystore, boolean acceptAnyCert)
          Validate a username/password pair using an LDAP directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

authenticate

public static boolean authenticate(java.lang.String userName,
                                   java.lang.String password,
                                   java.lang.String ldapURL,
                                   java.lang.String ldapPrincipal,
                                   java.lang.String keystore,
                                   boolean acceptAnyCert)
Validate a username/password pair using an LDAP directory.

Parameters:
userName - The user name.
password - The password.
ldapURL - The LDAP service URL.
ldapPrincipal - The LDAP principal string.
keystore - The path to the SSL keystore if a non-standard certificate is used. Set to the empty string if not needed.
acceptAnyCert - True to accept any certificate as valid. The keystore is ignored.
Returns:
True if validation successful.

authenticate

public static boolean authenticate(java.lang.String userName,
                                   java.lang.String password,
                                   java.lang.String ldapURL,
                                   java.lang.String ldapPrincipal)
Validate a username/password pair using an LDAP directory.

Parameters:
userName - The user name.
password - The password.
ldapURL - The LDAP service URL.
ldapPrincipal - The LDAP principal string.
Returns:
True if validation successful.

This method accepts any SSL certificate as valid. No keystore need be provided.