Class TwoFactorAuthenticationHandler

java.lang.Object
ch.tocco.nice2.security.spi.auth.AuthenticationHandlerAdapter
ch.tocco.nice2.userbase.impl.auth.TwoFactorAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler

@Component @Order(300) public class TwoFactorAuthenticationHandler extends AuthenticationHandlerAdapter
  • Field Details

  • Constructor Details

  • Method Details

    • authenticate

      public void authenticate(Challenge challenge, Credentials credentials)
      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 interface AuthenticationHandler
      Overrides:
      authenticate in class AuthenticationHandlerAdapter
      Parameters:
      challenge - the authentication challenge
      credentials - the credentials supplied by client in case of non-recoverable error. An exception will immediately stop authentication process to failed state.
    • createTotp

      protected org.jboss.aerogear.security.otp.Totp createTotp(String secret)
    • postAuthenticate

      public void postAuthenticate(Challenge challenge)
      Description copied from interface: AuthenticationHandler

      After authentication has been successful for all registered AuthenticationHandlers, the post-authentication step is invoked to add more authorization information to the principal which is sure to be not null and authenticated when this method is 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.

      Specified by:
      postAuthenticate in interface AuthenticationHandler
      Overrides:
      postAuthenticate in class AuthenticationHandlerAdapter
      Parameters:
      challenge - the challenge to authenticate