Class WeChatAuthenticationFilter
- java.lang.Object
-
- org.springframework.web.filter.GenericFilterBean
-
- org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
-
- org.oxerr.spring.security.wechat.web.authentication.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
-
Constructor Summary
Constructors Constructor Description WeChatAuthenticationFilter(WeChatService weChatService)
-
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
-
-
-
-
Field Detail
-
AUTH_DENY_ATTRIBUTE_NAME
private final String AUTH_DENY_ATTRIBUTE_NAME
-
weChatService
private final WeChatService weChatService
-
-
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 interfacejavax.servlet.Filter
- Overrides:
doFilter
in classorg.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 classorg.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
- Throws:
org.springframework.security.core.AuthenticationException
IOException
javax.servlet.ServletException
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classorg.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
-
isInWeChat
protected boolean isInWeChat(javax.servlet.http.HttpServletRequest request) throws IOException
- Throws:
IOException
-
-