博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spring security原理图及其解释
阅读量:6254 次
发布时间:2019-06-22

本文共 3430 字,大约阅读时间需要 11 分钟。

用户发出订单修改页面的请求,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.

转载地址:http://gejsa.baihongyu.com/

你可能感兴趣的文章
局域网的传输介质、网线水晶头制作图解教程
查看>>
android学习从模仿开始 —— 模仿UI 导航帖
查看>>
javascript 技巧总结积累173-231条(正在积累中)
查看>>
Linux内核实践之工作队列【转】
查看>>
在好多网站上的注册都用了无刷新验证用户名
查看>>
语言处理程序
查看>>
CSS解构系列之-新浪页面解构-02
查看>>
Windows 7安装软件时无法将注册值写入注册表的处理方法
查看>>
eKing Cloud基础云平台演进之路
查看>>
JExcelAPI修改Excel的实例
查看>>
Process J007 died, see its trace file
查看>>
PLSQL Developer V8.0.3 和 PLSQL Developer V9.0.2 的注册码
查看>>
MVC文件上传与下载
查看>>
Storm概念学习系列之storm的雪崩
查看>>
[C#]C#补习——类与方法
查看>>
代替数据库的自增主键的解决方案,解决了批量导数据ID出错的问题
查看>>
程序员编程艺术第十二~十五章:IP访问次数,回文等问题(初稿)
查看>>
[ACM_暴力][ACM_几何] ZOJ 1426 Counting Rectangles (水平竖直线段组成的矩形个数,暴力)...
查看>>
设计模式(五):PROTOTYPE原型模式 -- 创建型模式
查看>>
融云rongCloud聊天室的使用
查看>>