spring security 相关过滤器

Spring Security 提供了 30 多个过滤器。默认情况下Spring Boot 在对 SpringSecurity 进入自动化配置时,会创建一个名为 SpringSecurityFilerChain 的过滤器,并注入到Spring容器中,这个过滤器将负责所有的安全管理,包括用户认证、授权、重定向到登录页面等

一、过滤器整理

|-------------------------------------------------|------------------------------------------|-------------|
| #### 过滤器 | #### 过滤器作用 | #### 默认是否加载 |
| ChannelProcessingFilter | 过滤请求协议 HTTP、HTTPS | NO |
| WebAsyncManagerIntegrationFilter | 将WebAsyncManger 与SpringSecurity 上下文进行集成 | Yes |
| SecurityContextPersistenceFilter | 在处理请求之前,将安全信息加载到 SecurityContextHolder 中 | Yes |
| HeaderWriterFilter | 处理头信息加入响应中 | Yes |
| CorsFilter | 处理跨域问题 | NO |
| CsrfFilter | 处理CSRF攻击 | Yes |
| LogoutFilter | 处理注销登录 | YES |
| OAuth2AuthorizationRequestRedirectFilter | 处理OAuth2认证重定向 | NO |
| Saml2WebSsoAuthenticationRequestFilter | 处理SAML认证 | NO |
| X509AuthenticationFilter | 处理X509认证 | No'' |
| AbstractPreAuthenticatedProcessingFilter | 处理OAuth2认证 | No'' |
| Saml2WebSsoAuthenticationFilter | 处理SAML认证 | No'' |
| UsernamePasswordAuthenticationFilter | 处理表单登录 | Yes |
| OpenIDAuthenticationFilter | 处理OpenID 认证 | No |
| DefaultLoginPageGeneratingFilter | 配置默认登录页面 | YES |
| DefaultLogoutPageGeneratingFilter | 配置默认注销页面 | YES |
| ConcurrentSessionFilter | 处理 Session 有效期 | No |
| DigestAuthenticationFilter | 处理HTTP摘要认证 | No |
| BearerTokenAuthenticationFilter | 处理OAuth2认证的Access Token | NO |
| BasicAuthenticationFilter | 处理HttpBasic登录 | YES |
| RequestCacheAwareFilter | 处理请求缓存 | YES |
| SecurityContextHolder<br />AwareRequestFilter | 包装原始请求 | YES |
| JaasApilntegrationFilter | 处理JAAS认证 | No |
| RememberMeAuthenticationFilter | 处理RememberMe登录 | NO |
| AnonymousAuthenticationFilter | 配置匿名认证 | YES |
| OAuth2AuthorizationCodeGrantFilter | 处理OAuth2认证中授权码 | No |
| SessionManagementFilter | 处理session 并发问题 | Yes |
| ExceptionTranslationFilter | 处理认证/授权中的异常 | Yes |
| FilterSecurityInterceptor | 处理授权相关 | Yes |
| SwitchUserFilter | 处理账户切换 | No |

二、官方文档

相关推荐
玄昌盛不会编程15 分钟前
LeetCode——2243. 计算字符串的数字和
java·算法·leetcode
七夜zippoe18 分钟前
流式输出:让 AI 回答像打字机一样实时返回(SSE 全链路实战)
人工智能·spring·ai·流式输出·ssf
文丑颜不良啊25 分钟前
LeetCode3061~3080题目解析
java·leetcode
装不满的克莱因瓶40 分钟前
【AI时代必学】一篇文章教会你从零搭建Serverless架构
java·人工智能·ai·云原生·架构·serverless
七夜zippoe2 小时前
多轮对话管理:Session/记忆在 Java 后端怎么存(存储设计实战)
java·开发语言·ai·session·记忆
杨凯凡2 小时前
Spring Boot 事务提交后消息仍会丢?TransactionalEventListener 与 Outbox 可靠投递实战
java·spring boot
Java后端的Ai之路3 小时前
Java并发编程22-Lock接口
java·人工智能·prompt·lock
文丑颜不良啊3 小时前
LeetCode3081~3100题目解析
java·leetcode
SimonKing3 小时前
快讯!local-notes素笺笔记又又又更新了!
java·后端·程序员
Rain的Java大神之路3 小时前
面试官:设计一个自动售货机系统。我:别急着写代码,先问5个问题|状态机+防超卖+断电自愈,一套答法讲透
java·后端·面试