Class AuthenticationChain
- java.lang.Object
-
- com.logicaldoc.core.security.authentication.AbstractAuthenticator
-
- com.logicaldoc.core.security.authentication.AuthenticationChain
-
- All Implemented Interfaces:
Authenticator
public class AuthenticationChain extends AbstractAuthenticator
This authentication component implements a chain of possible authentication sources that will be invoked sequentially.- Since:
- 4.5
- Author:
- Sebastian Wenzky
-
-
Constructor Summary
Constructors Constructor Description AuthenticationChain()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Userauthenticate(String username, String password)Authenticates the user using the given credentials, if successful, the corresponding user is returned.Userauthenticate(String username, String password, String key)Authenticates the user using the given credentials, if successful, the corresponding user is returned.Userauthenticate(String username, String password, String key, Client client)Authenticates the user using the given credentials, if successful, the corresponding user is returned.booleancanAuthenticateUser(String user)booleanisEnabled()A provider can be in a disabled stateUserpickUser(String username)This method does not authenticate the user but just retrieves his details
-
-
-
Method Detail
-
authenticate
public final User authenticate(String username, String password, String key) throws AuthenticationException
Description copied from interface:AuthenticatorAuthenticates the user using the given credentials, if successful, the corresponding user is returned.- Specified by:
authenticatein interfaceAuthenticator- Overrides:
authenticatein classAbstractAuthenticator- Parameters:
username- the usernamepassword- the passwordkey- Optional third authentication parameter- Returns:
- The user, or null if the authentication was unsuccessful
- Throws:
AuthenticationException
-
authenticate
public final User authenticate(String username, String password) throws AuthenticationException
Description copied from interface:AuthenticatorAuthenticates 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:AuthenticatorAuthenticates the user using the given credentials, if successful, the corresponding user is returned.- Specified by:
authenticatein interfaceAuthenticator- Overrides:
authenticatein 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
public User pickUser(String username)
Description copied from interface:AuthenticatorThis 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
public boolean canAuthenticateUser(String user)
- Specified by:
canAuthenticateUserin interfaceAuthenticator- Overrides:
canAuthenticateUserin classAbstractAuthenticator
-
isEnabled
public boolean isEnabled()
Description copied from interface:AuthenticatorA provider can be in a disabled state- Specified by:
isEnabledin interfaceAuthenticator- Overrides:
isEnabledin classAbstractAuthenticator- Returns:
- if this authenticator is enabled
-
-