Package org.opendaylight.aaa.shiro.realm
Class TokenAuthRealm
java.lang.Object
org.apache.shiro.realm.CachingRealm
org.apache.shiro.realm.AuthenticatingRealm
org.apache.shiro.realm.AuthorizingRealm
org.opendaylight.aaa.shiro.realm.TokenAuthRealm
- All Implemented Interfaces:
org.apache.shiro.authc.LogoutAware
,org.apache.shiro.authz.Authorizer
,org.apache.shiro.authz.permission.PermissionResolverAware
,org.apache.shiro.authz.permission.RolePermissionResolverAware
,org.apache.shiro.cache.CacheManagerAware
,org.apache.shiro.realm.Realm
,org.apache.shiro.util.Initializable
,org.apache.shiro.util.Nameable
public class TokenAuthRealm
extends org.apache.shiro.realm.AuthorizingRealm
TokenAuthRealm is an adapter between the AAA shiro subsystem and the existing
TokenAuth
mechanisms. Thus, one
can enable use of IDMStore
and IDMMDSALStore
.-
Constructor Summary
ConstructorsConstructorDescriptionTokenAuthRealm
(AuthenticationService authService, TokenAuthenticators authenticators) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.shiro.authc.AuthenticationInfo
doGetAuthenticationInfo
(org.apache.shiro.authc.AuthenticationToken authenticationToken) protected org.apache.shiro.authz.AuthorizationInfo
doGetAuthorizationInfo
(org.apache.shiro.subject.PrincipalCollection principalCollection) static Registration
prepareForLoad
(AuthenticationService authService, TokenAuthenticators authenticators) Methods inherited from class org.apache.shiro.realm.AuthorizingRealm
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, setRolePermissionResolver
Methods inherited from class org.apache.shiro.realm.AuthenticatingRealm
assertCredentialsMatch, clearCachedAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supports
Methods inherited from class org.apache.shiro.realm.CachingRealm
clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabled
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.shiro.util.Initializable
init
-
Constructor Details
-
TokenAuthRealm
public TokenAuthRealm() -
TokenAuthRealm
-
-
Method Details
-
prepareForLoad
public static Registration prepareForLoad(AuthenticationService authService, TokenAuthenticators authenticators) -
doGetAuthorizationInfo
protected org.apache.shiro.authz.AuthorizationInfo doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principalCollection) Roles are derived from
TokenAuth.authenticate()
. Shiro roles are identical to existing IDM roles.- Specified by:
doGetAuthorizationInfo
in classorg.apache.shiro.realm.AuthorizingRealm
-
doGetAuthenticationInfo
protected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken authenticationToken) throws org.apache.shiro.authc.AuthenticationException Authenticates against any
TokenAuth
registered with theServiceLocator
.- Specified by:
doGetAuthenticationInfo
in classorg.apache.shiro.realm.AuthenticatingRealm
- Throws:
org.apache.shiro.authc.AuthenticationException
-