Class ForcedTwoFactorAuthenticationHandler
java.lang.Object
ch.tocco.nice2.security.spi.auth.AuthenticationHandlerAdapter
ch.tocco.nice2.userbase.impl.auth.ForcedTwoFactorAuthenticationHandler
- All Implemented Interfaces:
AuthenticationHandler
@Component
@Order(500)
public class ForcedTwoFactorAuthenticationHandler
extends AuthenticationHandlerAdapter
-
Field Summary
Fields inherited from interface ch.tocco.nice2.security.spi.auth.AuthenticationHandler
ANONYMOUS_HANDLER_ORDER, API_KEY_PK_ATTRIBUTE, PRINCIPAL_PK_ATTRIBUTE, SESSION_HASH_HANDLER_ORDER, SESSION_ID_ATTRIBUTE
-
Constructor Summary
ConstructorDescriptionForcedTwoFactorAuthenticationHandler
(org.slf4j.Logger log, SecurityManager securityManager, PrincipalManager principalManager, PersistenceService persistenceService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticate
(Challenge challenge, Credentials credentials) Authenticates the given challenge by voting for or against it.void
postEventListeners
(Challenge challenge) After authentication has been successful for all registered AuthenticationHandlers and after the success event listeners have been call, the postEventListeners step is invoked.Methods inherited from class ch.tocco.nice2.security.spi.auth.AuthenticationHandlerAdapter
getName, postAuthenticate, updateCredentials
-
Field Details
-
ORDER
public static final int ORDER- See Also:
-
-
Constructor Details
-
ForcedTwoFactorAuthenticationHandler
public ForcedTwoFactorAuthenticationHandler(org.slf4j.Logger log, SecurityManager securityManager, PrincipalManager principalManager, PersistenceService persistenceService)
-
-
Method Details
-
authenticate
Description copied from interface:AuthenticationHandler
Authenticates the given challenge by voting for or against it.
If the supplied credentials are unknown to this handler, it may not vote at all, indicating no meaningful knowledge about the challenge.
- Specified by:
authenticate
in interfaceAuthenticationHandler
- Overrides:
authenticate
in classAuthenticationHandlerAdapter
- Parameters:
challenge
- the authentication challengecredentials
- the credentials supplied by client in case of non-recoverable error. An exception will immediately stop authentication process to failed state.
-
postEventListeners
Description copied from interface:AuthenticationHandler
After authentication has been successful for all registered AuthenticationHandlers and after the success event listeners have been call, the postEventListeners step is invoked. This could be useful if something needs to be checked after the listeners have been invoked. This handler may also decide in this step to give a new vote for this challenge which overrides the previously given vote. If this throws any exception, authentication process is immediately stopped to failed state. Therefore, it may occur that the authentication listeners are called with state `SUCCESS` and after that again for the same challenge with state `FAILED`, if the authentication failed resp. was cancelled in this step.- Parameters:
challenge
- the authentication challenge
-