Shiro
走路的猫头鹰
疯狂学习中
展开
-
Shiro与Spring简单集成
Spring核心配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocat...原创 2018-07-03 21:21:22 · 106 阅读 · 0 评论 -
Shiro之加密加盐及凭证验证
MD5加密在Shiro中使用极其简单: shiro中工具类:SimpleHash //SimpleHash构造器 SimpleHash(String algorithmName, Object source, Object salt, int hashIterations) 参数解释: 参数名 参数解释 参数数据类型 algorithmName 加密类型...原创 2018-07-04 21:34:10 · 3281 阅读 · 1 评论 -
Shiro多Realm认证
查看源代码,发现: assertRealmsConfigured(); Collection<Realm> realms = getRealms(); if (realms.size() == 1) { return doSingleRealmAuthentication(realms.iterator().next(), authenticationToken); } ...原创 2018-07-05 09:57:38 · 296 阅读 · 0 评论 -
Shiro在Realm下允许用户指定匹配策略
查看源代码得出: Shiro中默认已经有以下匹配策略: AllSuccessfulStrategy AtLeastOneSuccessfulStrategy FirstSuccessfulStrategy Shiro与spring整合后在多Realm下修改匹配策略如下: <bean id="authenticator" class="org.apache.shiro.authc....原创 2018-07-05 10:12:38 · 448 阅读 · 0 评论 -
Shiro之授权
Shiro中授权功能通过继承AuthorizingRealm实现类或实现Realm接口,实现doGetAuthorizationInfo抽象方法来实现授权功能。 AuthorizingRealm与AuthenticatingRealm间关系如图: 从上图可知,AuthorizingRealm是AuthenticatingRealm的子类,且他们都为CachingRealm的子类。而Cach...原创 2018-07-05 14:49:25 · 130 阅读 · 0 评论