【细度经典】阅读spring security 官方文档Architecture部分

开始首先介绍了Servlet Filters

官网中提到

so it is helpful to look at the role of Filters generally first.

说明spring security 一系列操作是由Filters 完成的

在这里插入图片描述
接下来由上到下,介绍了全部的过滤代理器

DelegatingFilterProxy

spring 提供的一个实现:
我们来看看代码就明白了:
在这里插入图片描述

其实就是在过滤链中定义了一个位置,并且这个过滤器可以使用spring容器中的bean,我们看官方描述:Spring provides a Filter implementation named DelegatingFilterProxy that allows bridging between the Servlet container’s lifecycle and Spring’s ApplicationContext.

FilterChainProxy

这是spring security 提供的一个特殊过滤器,用来匹配对应的SecurityFilterChain,我们看官网描述: FilterChainProxy to determine which Spring Security Filters should be invoked for this request.
在这里插入图片描述

SecurityFilterChain

真正的过滤链,一个过滤链包含n个过滤器
在这里插入图片描述

Security Filters

真正通过的过滤器,其中有一些我们耳熟能详的过滤器。
Below is a comprehensive list of Spring Security Filter ordering:

  • ForceEagerSessionCreationFilter

  • ChannelProcessingFilter

  • WebAsyncManagerIntegrationFilter

  • SecurityContextPersistenceFilter

  • HeaderWriterFilter

  • CorsFilter

  • CsrfFilter

  • LogoutFilter

  • OAuth2AuthorizationRequestRedirectFilter

  • Saml2WebSsoAuthenticationRequestFilter

  • X509AuthenticationFilter

  • AbstractPreAuthenticatedProcessingFilter

  • CasAuthenticationFilter

  • OAuth2LoginAuthenticationFilter

  • Saml2WebSsoAuthenticationFilter

  • UsernamePasswordAuthenticationFilter

  • OpenIDAuthenticationFilter

  • DefaultLoginPageGeneratingFilter

  • DefaultLogoutPageGeneratingFilter

  • ConcurrentSessionFilter

  • DigestAuthenticationFilter

  • BearerTokenAuthenticationFilter

  • BasicAuthenticationFilter

  • RequestCacheAwareFilter

  • SecurityContextHolderAwareRequestFilter

  • JaasApiIntegrationFilter

  • RememberMeAuthenticationFilter

  • AnonymousAuthenticationFilter

  • OAuth2AuthorizationCodeGrantFilter

  • SessionManagementFilter

  • ExceptionTranslationFilter

  • FilterSecurityInterceptor

  • SwitchUserFilter

Handling Security Exceptions

单独说明了一下当出现异常的时候(比如未认证,等待其他异常) 是由谁来统一处理
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Alaia.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值