
spring security
文章平均质量分 81
iteye_8208
这个作者很懒,什么都没留下…
展开
-
转载:基于方法的权限控制
原文地址:http://haohaoxuexi.iteye.com/blog/2262363 之前介绍的都是基于URL的权限控制,spring Security同样支持对于方法的权限控制。可以通过intercept-methods对某个bean下面的方法进行权限控制,也可以通过pointcut对整个Service层的方法进行统一的权限控制,还可以通过注解定义对单独的某一个方...原创 2016-05-07 13:02:59 · 150 阅读 · 0 评论 -
spring security tags
//要使用security tags,必须在maven中加入tags的依赖<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>...原创 2016-05-11 22:39:18 · 255 阅读 · 0 评论 -
csrf ajax和fileupload
<!-- <csrf disabled="true"/>关闭csrf保护,spring建议所有request都应该使用csrf保护,默认是开启的 --><!-- <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> --&原创 2016-05-11 22:27:16 · 238 阅读 · 0 评论 -
转载:匿名认证
匿名认证: 对于匿名访问的用户,spring Security支持为其建立一个匿名的AnonymousAuthenticationToken存放在SecurityContextHolder中,这就是所谓的匿名认证。这样在以后进行权限认证或者做其它操作时我们就不需要再判断SecurityContextHolder中持有的Authentication对象是否为null了,而直...原创 2016-05-11 22:25:55 · 812 阅读 · 0 评论 -
转载:基于表达式的权限控制
原文地址:http://haohaoxuexi.iteye.com/blog/2247073 spring Security允许我们在定义URL访问或方法访问所应有的权限时使用Spring EL表达式,在定义所需的访问权限时如果对应的表达式返回结果为true则表示拥有对应的权限,反之则无。Spring Security可用表达式对象的基类是SecurityExpressio...原创 2016-05-11 22:22:50 · 108 阅读 · 0 评论 -
转载:jsp标签
原文地址:http://haohaoxuexi.iteye.com/blog/2263097 spring Security也有对Jsp标签的支持的标签库。其中一共定义了三个标签:authorize、authentication和accesscontrollist。其中authentication标签是用来代表当前Authentication对象的,我们可以利用它来展示当前...原创 2016-05-11 22:22:45 · 85 阅读 · 0 评论 -
spring security 自定义数据库权限
<bean id="filterSecurityInterceptor" class="org.springframework.security.web.access.intercept.FilterSecurityInterceptor"> <property name="authenticationManager" ref="authenticati...原创 2016-05-10 22:53:06 · 212 阅读 · 0 评论 -
spring security 自定义bean
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:security="http:...原创 2016-05-10 16:43:39 · 347 阅读 · 0 评论 -
rememberme关闭浏览器时重新登录应用时无法登录
rememberme关闭浏览器时再重启应用时无法登录,提示达到最大登录数,需要等待session超时才能登录。 原因是SessionManagementFilter在调用ConcurrentSessionControlAuthenticationStrategy.onAuthentication()时,由于直接关闭浏览器,当时的session仍然保存在SessionRe...原创 2016-05-08 18:55:09 · 720 阅读 · 0 评论 -
转载:核心类
原文地址:http://haohaoxuexi.iteye.com/blog/2155786 1.1 Authentication Authentication是一个接口,用来表示用户认证信息的,在用户登录认证之前相关信息会封装为一个Authentication具体实现类的对象,在登录认证成功之后又会生成一个信息更全面,包含用户权限等信息的Authenticati...原创 2016-05-07 13:38:56 · 108 阅读 · 0 评论 -
转载:Remember-Me
原文地址:http://haohaoxuexi.iteye.com/blog/2163997 1.1 概述 Remember-Me是指网站能够在Session之间记住登录用户的身份,具体来说就是我成功认证一次之后在一定的时间内我可以不用再输入用户名和密码进行登录了,系统会自动给我登录。这通常是通过服务端发送一个cookie给客户端浏览器,下次浏览器再访问...原创 2016-05-07 13:37:10 · 96 阅读 · 0 评论 -
转载:filter
原文地址:http://haohaoxuexi.iteye.com/blog/2161648 Spring Security的底层是通过一系列的Filter来管理的,每个Filter都有其自身的功能,而且各个Filter在功能上还有关联关系,所以它们的顺序也是非常重要的。 1.1 Filter顺序 Spring Security已经定义了...原创 2016-05-07 13:33:26 · 104 阅读 · 0 评论 -
转载:权限鉴定结构
原文地址:http://haohaoxuexi.iteye.com/blog/2247057 1.1 权限 所有的Authentication实现类都保存了一个GrantedAuthority列表,其表示用户所具有的权限。GrantedAuthority是通过AuthenticationManager设置到Authentication对象中的,然后AccessDec...原创 2016-05-07 13:04:34 · 104 阅读 · 0 评论 -
spring security.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" xsi:schema...原创 2016-05-12 12:04:20 · 168 阅读 · 0 评论