用户发出订单修改页面的请求,Access Decision Manager进行拦截,然后对比用户的授权和次页面需要的授权是不是有重合的部分,如果有重合的部分,那面页面就授权成功,如果失败就通知用户。

We can see that a component called the access decision manager is responsible for determining whether a principal has the appropriate level of access, based on the match between the authority possessed by the principal and the authority requested by the resource.

Adding the Spring DelegatingFilterProxy to your web.xml file

The o.s.web.filter.DelegatingFilterProxy is a servlet filter that allows Spring Security to wrap all application requests and ensure that they are appropriately secured.

Comprehending the overall flow of web requests and how they move through the chain of responsibility is crucial to our success with advanced topics in Spring Security. Keep in mind the basic concepts of authentication and authorization as they fit into the overall architecture of our protected system.

How requests are processed?

The Spring Security architecture relies heavily on the use of delegates and servlet filters to provide layers of functionality around the context of a web application request.

Servlet Filters (classes that implement the javax.servlet.Filter interface) are used to intercept user requests and perform pre-or post-processing, or redirect the request altogether, depending on the function of the servlet filter. The final destination servlet is the Spring MVC dispatcher servlet, in the case of the JBCP Pets online store, but in theory, it could represent any web servlet. The following

diagram illustrates how a servlet filter wraps a user's web request:

The automatic configuration attribute in the Spring Security XML configuration file sets up a series of ten servlet filters, which are applied in a sequence through the use of a Java EE servlet filter chain. The filter chain is a Java EE Servlet API concept specified by the javax.servlet.FilterChain interface that allows a web application to direct that a chain of servlet filters should apply to any given request.

Similar to a physical chain made from metal links, each servlet filter represents a link in the chain of method calls used to process the user's request. Requests travel along the chain, being processed by each filter in turn.

The automatic configuration option sets up 10 Spring Security filters for you. Understanding what these default filters do, and where and how they are configured, is critical to advanced work with Spring Security.

These filters, and the order in which they are applied, are described in the following table. Most of these filters will be described again as we proceed through our work on the JBCP Pets online store, so don't worry if you don't understand exactly what they do now.



You may wonder how the DelegatingFilterProxy is able to locate the filter chain that's configured by Spring Security. Recall that we needed to give the DelegatingFilterProxy a filter name in the web.xml file:

springSecurityFilterChain 
    
        org.springframework.web.filter.DelegatingFilterProxy

The name of this filter is no coincidence, and in fact is expected for Spring Security to wire itself to the DelegatingFilterProxy appropriately. Unless explicitly configured, the DelegatingFilterProxy will look for a configured bean in the Spring WebApplicationContext of the same name (as specified in the filter-name element). More detail on the configurability of the DelegatingFilterProxy is available in the Javadoc for the class.

转载于:https://www.cnblogs.com/haore147/p/5215782.html

spring security原理图及其解释相关推荐

  1. Spring Security入门到实践(一)HTTP Basic在Spring Security中的应用原理浅析

    一.Spring Security简介 打开Spring Security的官网,从其首页的预览上就可以看见如下文字: Spring Security is a powerful and highly ...

  2. Spring Security 中最流行的权限管理模型!

    前面和大家说了 ACL,讲了理论,也给了一个完整的案例,相信小伙伴们对于 ACL 权限控制模型都已经比较了解了. 本文我要和大家聊一聊另外一个非常流行的权限管理模型,那就是 RBAC. 1.RBAC ...

  3. 深入浅出Spring Security(三):FilterChainProxy的运行过程

    上篇回顾 我们已经知道了Spring Security的核心过滤器的创建和原理,本文主要介绍核心过滤器FilterChainProxy是如何在tomcat的ServletContext中生效的. Se ...

  4. Spring Security OAuth 2开发者指南译

    Spring Security OAuth 2开发者指南译 介绍 这是用户指南的支持OAuth 2.0.对于OAuth 1.0,一切都是不同的,所以看到它的用户指南. 本用户指南分为两部分,第一部分为 ...

  5. Spring Security 入门(四):自定义-Filter

    前文导读 - Spring Security入门(一):登录与退出 - Spring Security入门(二):基于数据库验证 - Spring Security入门(三):密码加密 本文解决问题 ...

  6. Spring Security入门(三):密码加密

    前文导读 - Spring Security入门(一):登录与退出 - Spring Security入门(二):基于数据库验证 Github 地址 https://github.com/ChinaS ...

  7. 【Spring】12、Spring Security 四种使用方式

    spring security使用分类: 如何使用spring security,相信百度过的都知道,总共有四种用法,从简到深为:1.不用数据库,全部数据写在配置文件,这个也是官方文档里面的demo: ...

  8. refreshtoken用mysql_「SpringCloud」 Spring Security OAuth2 Mysql管理在线Token

    原标题:「SpringCloud」 Spring Security OAuth2 Mysql管理在线Token 前言:Spring Cloud 分布式中的登录如何可视化的管理目前下发的令牌.使用情况. ...

  9. springsecurity sessionregistry session共享_不用 Spring Security 可否?试试这个小而美的安全框架...

    写在前面 在一款应用的整个生命周期,我们都会谈及该应用的数据安全问题.用户的合法性与数据的可见性是数据安全中非常重要的一部分.但是,一方面,不同的应用对于数据的合法性和可见性要求的维度与粒度都有所区别 ...

  10. springsecurity sessionregistry session共享_要学就学透彻!Spring Security 中 CSRF 防御源码解析...

    今日干货 刚刚发表查看:66666回复:666 公众号后台回复 ssm,免费获取松哥纯手敲的 SSM 框架学习干货. 上篇文章松哥和大家聊了什么是 CSRF 攻击,以及 CSRF 攻击要如何防御.主要 ...

最新文章

  1. FusionNet:基于稀疏雷达点云和RGB图像的深度图补全
  2. oracle10gr2 x86,Oracle10gR2 On RHEL5 x86安装技术文档(英文原版)
  3. MySQL中如何查询数据(上)
  4. JavaScript debugger time out and defer.resolve
  5. Oracle+ASM单机环境下,开启归档的最简单的方法
  6. Python 用pygame模块播放MP3
  7. 6日下午3h直播预告丨我们聊聊“数据库安全与智能运维”
  8. ElasticSearch 各模块介绍及参数配置详解
  9. linux yum libsasl2,CentOS8 yum 凡是安装 安装mysql +需要:libsasl2.so.2()(64bit)
  10. javascript使用栈结构将中缀表达式转换为后缀表达式并计算值
  11. 关于Java的权限修饰符(public,private,protected,默认friendly)
  12. 百度AI输入法发布全感官输入2.0版本,语音技术取得世界级突破...
  13. 利用计算机发布调度命令时必须严格遵守,调度命令规范格式(22页)-原创力文档...
  14. 【python】Python学到什么程度可以面试工作
  15. MATLAB与STK互联39:动画控制、地面两个点的大圆距离计算
  16. css hr标签 各种样式
  17. 计算机发展简史的ppt教程,计算机发展简史PPT.ppt
  18. 免费ofd在线转PDF
  19. 状态压缩:对动态规划进行降维打击
  20. 给大家介绍一个PDF图书下载网站,还有TXT图书下载

热门文章

  1. 路由器将迎重磅升级 WiFi速度提升3倍
  2. ajax提交与上传文件同步
  3. 统一软件开发过程(rup)理解
  4. Windows Hook机制
  5. [CTO札记]雅虎主页改版使用户停留时间增加20% -
  6. samba (centos6.5)服务
  7. QBC检索和本地SQL检索
  8. 2.5配置自定义HttpMessageConverters
  9. 1.1.3开启线程(Starting a Thread)
  10. 线程池ThreadPoolExecutor使用