A very simple example of user authentication with LDAP. There is a small invisible JavaBean - LDAPSimpleAuth. JavaScript fetches user-entered values and validates the user against the specified directory, by setting properties on LDAPSimpleAuth and calling its authenticate() method.

An example of an entry to test is:
User ID: prose
Password: regatta
Host:
Port:
Directory base:
User ID:
Password:

The JavaScript code to do this is as follows:

	auth = new netscape.ldap.beans.LDAPSimpleAuth();
	auth.setHost( document.input.host.value );
	auth.setPort( parseInt(document.input.port.value) );
	auth.setBase( document.input.base.value );
	auth.setUserID( document.input.username.value );
	auth.setAuthPassword( document.input.password.value );
	result = auth.authenticate();
	alert( "The response is: " + result );