public class ApiKeyRealm
extends org.apache.shiro.realm.AuthorizingRealm
| Constructor and Description |
|---|
ApiKeyRealm(String name,
org.apache.shiro.cache.CacheManager cacheManager,
AuthIdentityManager<ApiKey> authIdentityManager,
PermissionManager permissionManager,
String anonymousId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection principals)
Override default behavior to only clear cached authentication info if enabled.
|
protected void |
clearCachedAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
Override default behavior to only clear cached authorization info if enabled.
|
protected org.apache.shiro.authc.AuthenticationInfo |
doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
Gets the AuthenticationInfo that matches a token.
|
protected org.apache.shiro.authz.AuthorizationInfo |
doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
Gets the AuthorizationInfo that matches a token.
|
protected org.apache.shiro.cache.Cache<String,org.apache.shiro.authz.AuthorizationInfo> |
getAvailableInternalAuthorizationCache() |
protected org.apache.shiro.cache.Cache<String,RolePermissionSet> |
getAvailableRolesCache() |
org.apache.shiro.cache.Cache<String,org.apache.shiro.authz.AuthorizationInfo> |
getInternalAuthorizationCache() |
String |
getInternalAuthorizationCacheName() |
protected Collection<org.apache.shiro.authz.Permission> |
getPermissions(String role)
Gets the permissions for a role.
|
String |
getRolesCacheName() |
boolean |
hasPermissionByInternalId(String internalId,
org.apache.shiro.authz.Permission permission)
Test for whether an API key has a specific permission using its internal ID.
|
boolean |
hasPermissionByInternalId(String internalId,
String permission)
Test for whether an API key has a specific permission using its internal ID.
|
boolean |
hasPermissionsByInternalId(String internalId,
Collection<org.apache.shiro.authz.Permission> permissions)
Test for whether an API key has specific permissions using its internal ID.
|
boolean |
hasPermissionsByInternalId(String internalId,
org.apache.shiro.authz.Permission... permissions)
Test for whether an API key has specific permissions using its internal ID.
|
boolean |
hasPermissionsByInternalId(String internalId,
String... permissions)
Test for whether an API key has specific permissions using its internal ID.
|
protected void |
onInit() |
void |
setInternalAuthorizationCacheName(String name) |
void |
setName(String name) |
boolean |
supports(org.apache.shiro.authc.AuthenticationToken token)
Override the parent method to also accept anonymous tokens
|
afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getPermissions, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setPermissionResolver, setRolePermissionResolverassertCredentialsMatch, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcherclearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabledpublic ApiKeyRealm(String name, org.apache.shiro.cache.CacheManager cacheManager, AuthIdentityManager<ApiKey> authIdentityManager, PermissionManager permissionManager, @Nullable String anonymousId)
protected void onInit()
onInit in class org.apache.shiro.realm.AuthorizingRealmpublic boolean supports(org.apache.shiro.authc.AuthenticationToken token)
supports in interface org.apache.shiro.realm.Realmsupports in class org.apache.shiro.realm.AuthenticatingRealmprotected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
throws org.apache.shiro.authc.AuthenticationException
doGetAuthenticationInfo in class org.apache.shiro.realm.AuthenticatingRealmorg.apache.shiro.authc.AuthenticationExceptionprotected org.apache.shiro.authz.AuthorizationInfo doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
doGetAuthorizationInfo in class org.apache.shiro.realm.AuthorizingRealmpublic void setName(String name)
setName in interface org.apache.shiro.util.NameablesetName in class org.apache.shiro.realm.AuthorizingRealmpublic String getRolesCacheName()
public void setInternalAuthorizationCacheName(String name)
public String getInternalAuthorizationCacheName()
protected org.apache.shiro.cache.Cache<String,RolePermissionSet> getAvailableRolesCache()
public org.apache.shiro.cache.Cache<String,org.apache.shiro.authz.AuthorizationInfo> getInternalAuthorizationCache()
protected org.apache.shiro.cache.Cache<String,org.apache.shiro.authz.AuthorizationInfo> getAvailableInternalAuthorizationCache()
protected Collection<org.apache.shiro.authz.Permission> getPermissions(String role)
protected void clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection principals)
clearCachedAuthenticationInfo in class org.apache.shiro.realm.AuthenticatingRealmprotected void clearCachedAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
clearCachedAuthorizationInfo in class org.apache.shiro.realm.AuthorizingRealmpublic boolean hasPermissionByInternalId(String internalId, String permission)
public boolean hasPermissionByInternalId(String internalId, org.apache.shiro.authz.Permission permission)
public boolean hasPermissionsByInternalId(String internalId, String... permissions)
public boolean hasPermissionsByInternalId(String internalId, org.apache.shiro.authz.Permission... permissions)
public boolean hasPermissionsByInternalId(String internalId, Collection<org.apache.shiro.authz.Permission> permissions)
Copyright © 2017. All Rights Reserved.