public class LDAPSimpleAuth extends LDAPBasePropertySupport implements java.io.Serializable
function checkAuthentication() { auth = new Packages.netscape.ldap.beans.LDAPSimpleAuth(); auth.setHost( document.input.host.value ); auth.setPort( parseInt(document.input.port.value) ); auth.setAuthDN( document.input.username.value ); auth.setAuthPassword( document.input.password.value ); result = auth.authenticate(); alert( "The response is: " + result ); }
AMBIGUOUS_RESULTS, AUTHENTICATION_ERROR, CONNECT_ERROR, INVALID_PARAMETER, NO_SUCH_OBJECT, OK, PROPERTY_NOT_FOUND
Constructor and Description |
---|
LDAPSimpleAuth()
Constructor with no parameters
|
LDAPSimpleAuth(java.lang.String theHost,
int thePort)
Constructor with host and port initializers
|
LDAPSimpleAuth(java.lang.String theHost,
int thePort,
java.lang.String dn,
java.lang.String password)
Constructor with all required authentication parameters
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
authenticate()
Connect to LDAP server using parameters specified in
constructor and/or by setting properties and attempt to
authenticate.
|
void |
authenticate(java.awt.event.ActionEvent x) |
java.lang.String |
authenticate(java.lang.String dn,
java.lang.String password)
Connect to LDAP server using parameters specified in
constructor and/or by setting properties and attempt to
authenticate.
|
static void |
main(java.lang.String[] args)
The main body if we run it as stand-alone application.
|
addPropertyChangeListener, connect, convertToString, firePropertyChange, getAuthDN, getAuthPassword, getBase, getDebug, getErrorCode, getFilter, getHost, getPort, getScope, getUserID, getUserName, printDebug, removePropertyChangeListener, setAuthDN, setAuthPassword, setBase, setDebug, setDefaultReferralCredentials, setErrorCode, setFilter, setHost, setPort, setScope, setUserID, setUserName
public LDAPSimpleAuth()
public LDAPSimpleAuth(java.lang.String theHost, int thePort)
theHost
- host stringthePort
- port numberpublic LDAPSimpleAuth(java.lang.String theHost, int thePort, java.lang.String dn, java.lang.String password)
theHost
- host stringthePort
- port numberdn
- fully qualified distinguished name to authenticatepassword
- password for authenticating the dnpublic java.lang.String authenticate()
public java.lang.String authenticate(java.lang.String dn, java.lang.String password)
dn
- fully qualified distinguished name to authenticatepassword
- password for authenticating the dnpublic void authenticate(java.awt.event.ActionEvent x)
public static void main(java.lang.String[] args)
args
- list of arguments