public class UserAuthServiceFilter extends SecurityRequestFilter implements org.springframework.beans.factory.InitializingBean
用户认证逻辑
即判断用户请求里携带的访问令牌是否为合法且在有效状态 ,同时判断一下该用户的账号的状态
用于在非oauth2的情况下,在仅仅使用spring Security时系统从用户提供的请求里解析出认证信息,判断用户是否能够认证
在此情况下,除了忽视资源和非管理资源不需要经过该逻辑,理论上一版情况下其他资源都要经过该逻辑Constructor and Description |
---|
UserAuthServiceFilter(PropertyResource propertyResource,
HandlerProcessor handlerProcessor,
SecurityTokenExtractor securityTokenExtractor,
SecurityHelper securityHelper) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
用于标明将该过滤器实例配置到spring security过滤器的那个点上
|
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain) |
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
public UserAuthServiceFilter(PropertyResource propertyResource, HandlerProcessor handlerProcessor, SecurityTokenExtractor securityTokenExtractor, SecurityHelper securityHelper)
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, IOException
doFilterInternal
in class org.springframework.web.filter.OncePerRequestFilter
javax.servlet.ServletException
IOException
public void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
SecurityRequestFilter
configure
in class SecurityRequestFilter
http
- HttpSecurityException
- 配置时出现问题public void afterPropertiesSet() throws javax.servlet.ServletException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.web.filter.GenericFilterBean
javax.servlet.ServletException
Copyright © 2021. All rights reserved.