Authenticating the user against the password file

The AuthHttpENEConnection class has a login method to read the password file for authentication.

Use this AuthHttpENEConnection method to authenticate the user against the password file: These methods use the FileLoginModule plug-in to locate the password file (as specified by the passwordFile parameter in the Access Control configuration file) and read its contents.

If the user is not in the password file, the authentication will fail (if the FileLoginModule is marked as required in the Access Control configuration file) and the user will not be allowed access to the Endeca implementation.

Java implementation

If the user has supplied a username and password, an example of the call to authenticate the user would be:
// Authenticate the user via a local password file.
nec.login(new StaticCallbackHandler(name, password));

The StaticCallbackHandler object provides the user name and password. If the login attempt fails, an ENEAuthenticationException exception is thrown.

.NET implementation

The .NET version of the Login method has this signature:
Login(IAuthCredentialRequestHandler handler)
where handler is an IAuthCredentialRequestHandler object instance that provides the mechanism to obtain credentials for authentication purposes.
To use an example, if the user has supplied a username and password, the call to authenticate the user would be:
//Authenticate the user
nec.Login(new StaticCredentialRequestHandler(user, pass));

The StaticCredentialRequestHandler object provides the user name and password. If the login attempt fails, an ENEAuthenticationException exception is thrown.