netscape.ldap.beans
Class LDAPSimpleAuth
- Serializable
public class LDAPSimpleAuth
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":
LDAPSimpleAuth() - Constructor with no parameters
|
LDAPSimpleAuth(String theHost, int thePort) - Constructor with host and port initializers
|
LDAPSimpleAuth(String theHost, int thePort, String dn, String password) - Constructor with all required authentication parameters
|
String | authenticate() - Connect to LDAP server using parameters specified in
constructor and/or by setting properties and attempt to
authenticate.
|
void | authenticate(ActionEvent x)
|
String | authenticate(String dn, String password) - Connect to LDAP server using parameters specified in
constructor and/or by setting properties and attempt to
authenticate.
|
static void | main(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 |
LDAPSimpleAuth
public LDAPSimpleAuth()
Constructor with no parameters
LDAPSimpleAuth
public LDAPSimpleAuth(String theHost,
int thePort)
Constructor with host and port initializers
theHost
- host stringthePort
- port number
LDAPSimpleAuth
public LDAPSimpleAuth(String theHost,
int thePort,
String dn,
String password)
Constructor with all required authentication parameters
theHost
- host stringthePort
- port numberdn
- fully qualified distinguished name to authenticatepassword
- password for authenticating the dn
authenticate
public String authenticate()
Connect to LDAP server using parameters specified in
constructor and/or by setting properties and attempt to
authenticate.
- "Y" on successful authentication, "N" otherwise
authenticate
public void authenticate(ActionEvent x)
authenticate
public String authenticate(String dn,
String password)
Connect to LDAP server using parameters specified in
constructor and/or by setting properties and attempt to
authenticate.
dn
- fully qualified distinguished name to authenticatepassword
- password for authenticating the dn
- "Y" on successful authentication, "N" otherwise
main
public static void main(args[] )
The main body if we run it as stand-alone application.