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 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 state
-
-
-
Method Detail
-
authenticate
public final User authenticate(String username, String password, String key) 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 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: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
-
canAuthenticateUser
public boolean canAuthenticateUser(String user)
- Specified by:
canAuthenticateUser
in interfaceAuthenticator
- Overrides:
canAuthenticateUser
in classAbstractAuthenticator
-
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
-
-