AuthenticatingSecurityManager

Shiro support of a {@link SecurityManager} class hierarchy that delegates all authentication operations to a wrapped {@link Authenticator Authenticator} instance. That is, this class implements all the <tt>Authenticator</tt> methods in the {@link SecurityManager SecurityManager} interface, but in reality, those methods are merely passthrough calls to the underlying 'real' <tt>Authenticator</tt> instance.

<p>All other <tt>SecurityManager</tt> (authorization, session, etc) methods are left to be implemented by subclasses.

<p>In keeping with the other classes in this hierarchy and Shiro's desire to minimize configuration whenever possible, suitable default instances for all dependencies are created upon instantiation.

Constructors

this
this()

Default no-arg constructor that initializes its internal <code>authenticator</code> instance to a {@link hunt.shiro.authc.pam.ModularRealmAuthenticator ModularRealmAuthenticator}.

Members

Functions

afterRealmsSet
void afterRealmsSet()

Passes on the {@link #getRealms() realms} to the internal delegate <code>Authenticator</code> instance so that it may use them during authentication attempts.

authenticate
AuthenticationInfo authenticate(AuthenticationToken token)

Delegates to the wrapped {@link hunt.shiro.authc.Authenticator Authenticator} for authentication.

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
getAuthenticator
Authenticator getAuthenticator()

Returns the delegate <code>Authenticator</code> instance that this SecurityManager uses to perform all authentication operations. Unless overridden by the {@link #setAuthenticator(hunt.shiro.authc.Authenticator) setAuthenticator}, the default instance is a {@link hunt.shiro.authc.pam.ModularRealmAuthenticator ModularRealmAuthenticator}.

setAuthenticator
void setAuthenticator(Authenticator authenticator)

Sets the delegate <code>Authenticator</code> instance that this SecurityManager uses to perform all authentication operations. Unless overridden by this method, the default instance is a {@link hunt.shiro.authc.pam.ModularRealmAuthenticator ModularRealmAuthenticator}.

Inherited Members

From RealmSecurityManager

setRealm
void setRealm(Realm realm)

Convenience method for applications using a single realm that merely wraps the realm in a list and then invokes the {@link #setRealms} method.

setRealms
void setRealms(Realm[] realms)

Sets the realms managed by this <tt>SecurityManager</tt> instance.

afterRealmsSet
void afterRealmsSet()
Undocumented in source. Be warned that the author may not have intended to support it.
getRealms
Realm[] getRealms()

Returns the {@link Realm Realm}s managed by this SecurityManager instance.

applyCacheManagerToRealms
void applyCacheManagerToRealms()

Sets the internal {@link #getCacheManager CacheManager} on any internal configured {@link #getRealms Realms} that implement the {@link hunt.shiro.cache.CacheManagerAware CacheManagerAware} interface. <p/> This method is called after setting a cacheManager on this securityManager via the {@link #setCacheManager(hunt.shiro.cache.CacheManager) setCacheManager} method to allow it to be propagated down to all the internal Realms that would need to use it. <p/> It is also called after setting one or more realms via the {@link #setRealm setRealm} or {@link #setRealms setRealms} methods to allow these newly available realms to be given the cache manager already in use.

applyEventBusToRealms
void applyEventBusToRealms()

Sets the internal {@link #getEventBus EventBus} on any internal configured {@link #getRealms Realms} that implement the {@link EventBusAware} interface. <p/> This method is called after setting an eventBus on this securityManager via the {@link #setEventBus(hunt.shiro.event.EventBus) setEventBus} method to allow it to be propagated down to all the internal Realms that would need to use it. <p/> It is also called after setting one or more realms via the {@link #setRealm setRealm} or {@link #setRealms setRealms} methods to allow these newly available realms to be given the EventBus already in use.

afterCacheManagerSet
void afterCacheManagerSet()

Simply calls {@link #applyCacheManagerToRealms() applyCacheManagerToRealms()} to allow the newly set {@link hunt.shiro.cache.CacheManager CacheManager} to be propagated to the internal collection of <code>Realm</code> that would need to use it.

afterEventBusSet
void afterEventBusSet()
Undocumented in source. Be warned that the author may not have intended to support it.
destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta