Interface Authenticator
-
- All Known Implementing Classes:
AbstractAuthenticator
,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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description User
authenticate(String username, String password)
Authenticates the user using the given credentials, if successful, the corresponding user is returned.User
authenticate(String username, String password, String key)
Authenticates the user using the given credentials, if successful, the corresponding user is returned.User
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)
boolean
isEnabled()
A provider can be in a disabled stateUser
pickUser(String username)
This method does not authenticate the user but just retrieves his details
-
-
-
Method Detail
-
authenticate
User authenticate(String username, String password) throws AuthenticationException
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
User authenticate(String username, String password, String key) 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 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
boolean canAuthenticateUser(String user)
-
isEnabled
boolean isEnabled()
A provider can be in a disabled state- Returns:
- if this authenticator is enabled
-
-