Class MfaAuthenticationProvider

java.lang.Object
org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider
org.springframework.security.authentication.dao.DaoAuthenticationProvider
nl._42.restsecure.autoconfigure.authentication.mfa.MfaAuthenticationProvider
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware, org.springframework.security.authentication.AuthenticationProvider

public class MfaAuthenticationProvider extends org.springframework.security.authentication.dao.DaoAuthenticationProvider
An DaoAuthenticationProvider that supports Multi-Factor authentication (MFA, 2FA) using Time-based One-Time-Password (TOTP).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from class org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider

    hideUserNotFoundExceptions, logger, messages
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication)
     
    protected void
     
    void
     
    void
     
    boolean
    supports(Class<?> authentication)
     

    Methods inherited from class org.springframework.security.authentication.dao.DaoAuthenticationProvider

    createSuccessAuthentication, getPasswordEncoder, getUserDetailsService, retrieveUser, setPasswordEncoder, setUserDetailsPasswordService, setUserDetailsService

    Methods inherited from class org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider

    afterPropertiesSet, authenticate, getPostAuthenticationChecks, getPreAuthenticationChecks, getUserCache, isForcePrincipalAsString, isHideUserNotFoundExceptions, setAuthoritiesMapper, setForcePrincipalAsString, setHideUserNotFoundExceptions, setMessageSource, setPostAuthenticationChecks, setPreAuthenticationChecks, setUserCache

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • MfaAuthenticationProvider

      public MfaAuthenticationProvider()
  • Method Details

    • setVerificationChecks

      public void setVerificationChecks(List<MfaVerificationCheck> verificationChecks)
    • setMfaValidationService

      public void setMfaValidationService(MfaValidationService mfaValidationService)
    • doAfterPropertiesSet

      protected void doAfterPropertiesSet()
      Overrides:
      doAfterPropertiesSet in class org.springframework.security.authentication.dao.DaoAuthenticationProvider
    • additionalAuthenticationChecks

      protected void additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails userDetails, org.springframework.security.authentication.UsernamePasswordAuthenticationToken authentication) throws org.springframework.security.core.AuthenticationException
      Overrides:
      additionalAuthenticationChecks in class org.springframework.security.authentication.dao.DaoAuthenticationProvider
      Throws:
      org.springframework.security.core.AuthenticationException
    • supports

      public boolean supports(Class<?> authentication)
      Specified by:
      supports in interface org.springframework.security.authentication.AuthenticationProvider
      Overrides:
      supports in class org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider