Interface Authenticator
- All Known Implementing Classes:
AbstractAuthenticator
,ApiKeyAuthenticator
,AuthenticationChain
,DefaultAuthenticator
public interface Authenticator
Implementations of this interface must provide authentication of a user
against a defined source.
- Since:
- 4.5
- Author:
- Sebastian Wenzky
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(String username, String password) Authenticates the user using the given credentials, if successful, the corresponding user is returned.authenticate
(String username, String password, String key) Authenticates the user using the given credentials, if successful, the corresponding user is returned.authenticate
(String username, String password, String key, Client client) Authenticates the user using the given credentials, if successful, the corresponding user is returned.boolean
canAuthenticateUser
(String user) Checks if this authenticator can authenticate a userboolean
A provider can be in a disabled stateThis method does not authenticate the user but just retrieves his details
-
Method Details
-
authenticate
Authenticates the user using the given credentials, if successful, the corresponding user is returned.- Parameters:
username
- the usernamepassword
- the password- Returns:
- The user, or null if the authentication was unsuccessful
- Throws:
AuthenticationException
-
authenticate
Authenticates the user using the given credentials, if successful, the corresponding user is returned.- Parameters:
username
- the usernamepassword
- the passwordkey
- Optional third authentication parameter- Returns:
- The user, or null if the authentication was unsuccessful
- Throws:
AuthenticationException
-
authenticate
User authenticate(String username, String password, String key, Client client) throws AuthenticationException Authenticates the user using the given credentials, if successful, the corresponding user is returned.- Parameters:
username
- the usernamepassword
- the passwordkey
- Optional third authentication parameterclient
- Client informations- Returns:
- The user, or null if the authentication was unsuccessful
- Throws:
AuthenticationException
-
canAuthenticateUser
Checks if this authenticator can authenticate a user- Parameters:
user
- the username to authenticate- Returns:
- true only if this authenticator can authenticate the giver username
-
isEnabled
boolean isEnabled()A provider can be in a disabled state- Returns:
- if this authenticator is enabled
-
pickUser
This method does not authenticate the user but just retrieves his details- Parameters:
username
- username of the user to find- Returns:
- object representation of the user
- Throws:
PersistenceException
- Error in data layer
-