public class SummerUserRealm
extends org.apache.shiro.realm.AuthorizingRealm
构造说明 :
需要在 spring 中引入该类
<bean id="shiroDbRealm" class="com.liuqi.summer.security.SummerUserRealm" />
| 构造器和说明 |
|---|
SummerUserRealm() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected org.apache.shiro.authc.AuthenticationInfo |
doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken authcToken)
认证回调函数,登录时调用.
|
protected org.apache.shiro.authz.AuthorizationInfo |
doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
授权查询回调函数, 进行鉴权但缓存中无用户的授权信息时调用.
|
void |
initCredentialsMatcher()
设定Password校验的Hash算法与迭代次数.
|
void |
removeUserAuthorizationInfoCache(String account)
清空用户权限缓存
用户权限修改时,需要清空
|
afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, clearCachedAuthorizationInfo, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getPermissions, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, onInit, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setName, setPermissionResolver, setRolePermissionResolverassertCredentialsMatch, clearCachedAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supportsclearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabledprotected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken authcToken)
throws org.apache.shiro.authc.AuthenticationException
doGetAuthenticationInfo 在类中 org.apache.shiro.realm.AuthenticatingRealmauthcToken - 认证 token 在 login 时生成org.apache.shiro.authc.AuthenticationException - 异常protected org.apache.shiro.authz.AuthorizationInfo doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
doGetAuthorizationInfo 在类中 org.apache.shiro.realm.AuthorizingRealmprincipals - 信息public void removeUserAuthorizationInfoCache(String account)
account - 账号@PostConstruct public void initCredentialsMatcher()
Copyright © 2019. All rights reserved.