Storing the SecurityContext between requests
来源:互联网 发布:虚拟传真机软件 编辑:程序博客网 时间:2024/05/16 23:37
Storing the SecurityContext between requests
根据不同的应用程序类型,在用户操作的过程中需要有合适的策略来保存security信息。在一个典型的web应用中,一个用户登录系统之后就会被一个特有的session id所唯一标识,服务器会将session作用期间的principal数据保存在缓存中。在Spring Security中,保存SecurityContext的任务落在了SecurityContextPersistenceFilter身上,它默认将上下文当做HttpSession属性保存在http请求中,并且将每一个请求的上下文保存在SecurityContextHolder中,最重要的功能,是在请求结束之后,清理SecurityContextHolder。你不需要处于安全的目的直接和HttpSession打交道,在这里仅仅只是不需要那样做--总是使用SecurityContextHolder来代替HttpSession。
许多其他的应用(举个例子:一个无状态的RESTful风格web服务)不使用Http Session并且每次请求过来都会进行验证。然而比较重要的是:SecurityContextPersistenceFilter被包含在了过滤器链中,并确保每次请求完毕之后清理SecurityContextHolder。
参考资料来自《Spring Security Reference Documentation(3.1)》,下载地址:http://download.csdn.net/detail/u010009900/9169039
0 0
- Storing the SecurityContext between requests
- The difference between (()) and ().
- The difference between focus() .
- the difference between…
- The difference between '?attr' between '?android:attr'
- The differences between some patterns.
- The differences between Linux distributions
- The difference between "ModifyMenu" & "EnableMenuItem"
- Relationship between the Linux Distros
- NOJ [1296] Between The Island
- the difference between "./" and "sh"
- 熟悉SecurityContext的第一步
- Spring Security-SecurityContext
- spring SecurityContext 退出处理
- spring securitycontext稍微说说
- Storing Photos in the Photo Library(储存相片至手机)
- Storing Videos in the Photo Library(储存视频至手机)
- Flickr shows it could still be the ultimate home for storing and sharing photos
- 判断点是否在多边形的内部(C#)
- vector、list、deque和map的区别
- 停止冒泡事件的方法(已兼容)
- ListView的动态刷新问题——用notifyDataSetChanged没作用
- qemu windows 32位安装过程
- Storing the SecurityContext between requests
- 图的表示和遍历
- 免费好软件推荐之Binary Viewer
- 【dp】bzoj 1021 循环的债务
- jqpl语法一
- C语言一个队列的实现
- 从零开始学习SLAM
- android 获取天气信息,解决了乱码的问题
- 超分辨率图像重建技术笔记