Class AuthenticationChain
java.lang.Object
com.logicaldoc.core.security.authentication.AbstractAuthenticator
com.logicaldoc.core.security.authentication.AuthenticationChain
- All Implemented Interfaces:
Authenticator
This authentication component implements a chain of possible authentication
sources that will be invoked sequentially.
- Since:
- 4.5
- Author:
- Sebastian Wenzky
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal User
authenticate
(String username, String password) Authenticates the user using the given credentials, if successful, the corresponding user is returned.final 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) 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 detailsMethods inherited from class com.logicaldoc.core.security.authentication.AbstractAuthenticator
authenticate
-
Constructor Details
-
AuthenticationChain
public AuthenticationChain()
-
-
Method Details
-
authenticate
Description copied from interface:Authenticator
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
public final User authenticate(String username, String password, String key, Client client) throws AuthenticationException Description copied from interface:Authenticator
Authenticates the user using the given credentials, if successful, the corresponding user is returned.- Specified by:
authenticate
in interfaceAuthenticator
- Overrides:
authenticate
in classAbstractAuthenticator
- Parameters:
username
- the usernamepassword
- the passwordkey
- Optional third authentication parameterclient
- Client informations- Returns:
- The user, or null if the authentication was unsuccessful
- Throws:
AuthenticationException
-
pickUser
Description copied from interface:Authenticator
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
-
canAuthenticateUser
Description copied from interface:Authenticator
Checks if this authenticator can authenticate a user- Specified by:
canAuthenticateUser
in interfaceAuthenticator
- Overrides:
canAuthenticateUser
in classAbstractAuthenticator
- Parameters:
user
- the username to authenticate- Returns:
- true only if this authenticator can authenticate the giver username
-
isEnabled
public boolean isEnabled()Description copied from interface:Authenticator
A provider can be in a disabled state- Specified by:
isEnabled
in interfaceAuthenticator
- Overrides:
isEnabled
in classAbstractAuthenticator
- Returns:
- if this authenticator is enabled
-