Class WeChatAuthenticationFilter

  • 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 WeChatAuthenticationFilter
    extends org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private String AUTH_DENY_ATTRIBUTE_NAME  
      private WeChatService weChatService  
      • 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
      void afterPropertiesSet()
      org.springframework.security.core.Authentication attemptAuthentication​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      void doFilter​(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)
      protected boolean isInWeChat​(javax.servlet.http.HttpServletRequest request)  
      • Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter

        getAllowSessionCreation, getAuthenticationManager, getFailureHandler, getRememberMeServices, getSuccessHandler, requiresAuthentication, setAllowSessionCreation, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setContinueChainBeforeSuccessfulAuthentication, setFilterProcessesUrl, setMessageSource, setRememberMeServices, setRequiresAuthenticationRequestMatcher, setSecurityContextRepository, setSessionAuthenticationStrategy, successfulAuthentication, 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

      • AUTH_DENY_ATTRIBUTE_NAME

        private final String AUTH_DENY_ATTRIBUTE_NAME
    • Constructor Detail

      • WeChatAuthenticationFilter

        public WeChatAuthenticationFilter​(WeChatService weChatService)
    • Method Detail

      • doFilter

        public void doFilter​(javax.servlet.ServletRequest req,
                             javax.servlet.ServletResponse res,
                             javax.servlet.FilterChain chain)
                      throws IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Overrides:
        doFilter in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
        Throws:
        IOException
        javax.servlet.ServletException
      • attemptAuthentication

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

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Overrides:
        afterPropertiesSet in class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
      • isInWeChat

        protected boolean isInWeChat​(javax.servlet.http.HttpServletRequest request)
                              throws IOException
        Throws:
        IOException