2.17.2: 2011-06-17

Interface Authenticator

All Known Implementing Classes:
POP3Authenticator, SimpleAuthenticator

public interface Authenticator

This interface defines the methods that needs to be implemented by a class to be able to use it for external authentication against another database or directory service.

Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Method Summary
 AuthenticationInformation authenticate(String login, String password)
          Authenticates a user.
 void init(String settings)
          Initialises the object.
 boolean supportsExtraInformation()
          Should return TRUE or FALSE depending on if the authentication server returns additional information about the user.

Method Detail


void init(String settings)
          throws AuthenticationException
Initialises the object. A client application should call this method immediately after object creation with some initialisation parameters. The contents and syntax of the settings string should be defined by the implementing class. It may for example be the URL for a database connection, the path to a properties file or simply the host name of the directory service provider.

settings - A string containing initialisation parameters
AuthenticationException - If the parameters are invalid


boolean supportsExtraInformation()
Should return TRUE or FALSE depending on if the authentication server returns additional information about the user.

TRUE if additional information is returned, FALSE otherwise.
See Also:
AuthenticationInformation, authenticate(String,String)


AuthenticationInformation authenticate(String login,
                                       String password)
                                       throws UnknownLoginException,
Authenticates a user. If the authentication succeeds a AuthenticationInformation object should be returned. The only required information in this object is the AuthenticationInformation.id and AuthenticationInformation.login fields. The id may or may not be the same as the login, but must be a unique string identifying the user.

If the authentication fails an exception should be thrown. Note! An implementation may choose to throw a AuthenticationException for all errors, even if it is an unknown user or invalid password.

login - The login name for the user
password - The password for the user
An AuthenticationInformation object
UnknownLoginException - This exception may be thrown if the server doesn't know about the user. It is also possible for an implmentation to throw an AuthenticationException
InvalidPasswordException - This exception may be thrown if the password is invalid. It is also possible for an implementation to throw an AuthenticationException
AuthenticationException - This exception is thrown if the authentication fails

2.17.2: 2011-06-17