Class OTPAuthenticationFilter

  • All Implemented Interfaces:
    javax.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.EnvironmentAware, org.springframework.context.MessageSourceAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

    public class OTPAuthenticationFilter
    extends org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private String oneTimePasswordParameter  
      static String SPRING_SECURITY_ONE_TIME_PASSWORD_KEY  
      • Fields inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter

        authenticationDetailsSource, eventPublisher, messages
      • Fields inherited from class org.springframework.web.filter.GenericFilterBean

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.security.core.Authentication attemptAuthentication​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected String obtainOneTimePassword​(javax.servlet.http.HttpServletRequest request)  
      protected boolean requiresAuthentication​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      void setOneTimePasswordParameter​(String oneTimePasswordParameter)  
      protected void successfulAuthentication​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain, org.springframework.security.core.Authentication authResult)  
      • Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter

        afterPropertiesSet, doFilter, getAllowSessionCreation, getAuthenticationManager, getFailureHandler, getRememberMeServices, getSuccessHandler, setAllowSessionCreation, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setContinueChainBeforeSuccessfulAuthentication, setFilterProcessesUrl, setMessageSource, setRememberMeServices, setRequiresAuthenticationRequestMatcher, setSecurityContextRepository, setSessionAuthenticationStrategy, unsuccessfulAuthentication
      • Methods inherited from class org.springframework.web.filter.GenericFilterBean

        addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
    • Field Detail

      • SPRING_SECURITY_ONE_TIME_PASSWORD_KEY

        public static final String SPRING_SECURITY_ONE_TIME_PASSWORD_KEY
        See Also:
        Constant Field Values
      • oneTimePasswordParameter

        private String oneTimePasswordParameter
    • Constructor Detail

      • OTPAuthenticationFilter

        public OTPAuthenticationFilter()
    • Method Detail

      • requiresAuthentication

        protected boolean requiresAuthentication​(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response)
        Overrides:
        requiresAuthentication in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
      • attemptAuthentication

        public org.springframework.security.core.Authentication attemptAuthentication​(javax.servlet.http.HttpServletRequest request,
                                                                                      javax.servlet.http.HttpServletResponse response)
                                                                               throws org.springframework.security.core.AuthenticationException
        Specified by:
        attemptAuthentication in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
        Throws:
        org.springframework.security.core.AuthenticationException
      • successfulAuthentication

        protected void successfulAuthentication​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response,
                                                javax.servlet.FilterChain chain,
                                                org.springframework.security.core.Authentication authResult)
                                         throws IOException,
                                                javax.servlet.ServletException
        Overrides:
        successfulAuthentication in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
        Throws:
        IOException
        javax.servlet.ServletException
      • obtainOneTimePassword

        protected String obtainOneTimePassword​(javax.servlet.http.HttpServletRequest request)
      • setOneTimePasswordParameter

        public void setOneTimePasswordParameter​(String oneTimePasswordParameter)