Class LDAPSimpleAuth

java.lang.Object
netscape.ldap.beans.LDAPBasePropertySupport
netscape.ldap.beans.LDAPSimpleAuth
All Implemented Interfaces:
Serializable

public class LDAPSimpleAuth extends LDAPBasePropertySupport implements Serializable
Invisible Bean that just authenticates a user with a Directory Server and returns Y or N. It takes a host and port, and then either a full distinguished name and password, an RDN and directory base, or a cn value and directory base.

Optionally, a client can register as a PropertyChangeListener and will be notified when an authentication completes.

The Bean can be used from JavaScript, as in the following example where the parameters are taken from HTML text fields in an HTML form called "input":
 
 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 );
 }
 
See Also: