Interface SecondFactorAuthenticator
- All Known Implementing Classes:
AbstractSecondFactorAuthenticator
,Duo
,EmailAuthenticator
,GoogleAuthenticator
,YubiKey
public interface SecondFactorAuthenticator
Defines an authenticator for the second factor in a Two Factor
Authentication. Implementations should support a specific method (typically a
security token).
- Since:
- 7.7.3
- Author:
- Marco Meschieri - LogicalDOC
-
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticate
(com.logicaldoc.core.security.user.User user, String key) Authenticates the given usergenerateKey
(com.logicaldoc.core.security.user.User user) The authentication method may require some kind of key generation before accepting the user login.boolean
isEnabledForUser
(com.logicaldoc.core.security.user.User user) Check if a user is enabler or not
-
Method Details
-
authenticate
void authenticate(com.logicaldoc.core.security.user.User user, String key) throws com.logicaldoc.core.security.authentication.AuthenticationException Authenticates the given user- Parameters:
user
- The user to checkkey
- The key inputed by the user- Throws:
com.logicaldoc.core.security.authentication.AuthenticationException
- the user was not authenticated
-
isEnabledForUser
boolean isEnabledForUser(com.logicaldoc.core.security.user.User user) Check if a user is enabler or not- Parameters:
user
- the user to check- Returns:
- true only if the user is enabled
-
generateKey
String generateKey(com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.security.authentication.AuthenticationException The authentication method may require some kind of key generation before accepting the user login. Concrete implementations should place here their key generation logic and notify the user accordingly.- Parameters:
user
- The user that will try to authenticate- Returns:
- the result of the key generation, it may be a transaction id
- Throws:
com.logicaldoc.core.security.authentication.AuthenticationException
- in case of whatever error
-