码迷,mamicode.com
首页 > 其他好文 > 详细

shiro验证时,当authenticationStrategy为AllSuccessfulStrategy时

时间:2014-12-05 10:37:18      阅读:333      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   on   div   

shiro验证时,当authenticationStrategy为AllSuccessfulStrategy时,如果某一个验证出错,那么

  PrincipalCollection principalCollection = subject.getPrincipals();获得principalCollection为空值。

[main]
#指定securityManager的authenticator实现
authenticator=org.apache.shiro.authc.pam.ModularRealmAuthenticator
securityManager.authenticator=$authenticator

#指定securityManager.authenticator的authenticationStrategy
allSuccessfulStrategy=org.apache.shiro.authc.pam.AllSuccessfulStrategy
securityManager.authenticator.authenticationStrategy=$allSuccessfulStrategy

myRealm1=com.github.zhangkaitao.shiro.chapter2.realm.MyRealm1
myRealm2=com.github.zhangkaitao.shiro.chapter2.realm.MyRealm2
myRealm3=com.github.zhangkaitao.shiro.chapter2.realm.MyRealm3
securityManager.realms=$myRealm1,$myRealm3

bubuko.com,布布扣

shiro验证时,当authenticationStrategy为AllSuccessfulStrategy时

标签:style   blog   http   io   ar   color   sp   on   div   

原文地址:http://www.cnblogs.com/oymx/p/4145858.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!