Class AuthenticatingSecurityManager

  • All Implemented Interfaces:
    Authenticator, Authorizer, org.apache.shiro.cache.CacheManagerAware, org.apache.shiro.event.EventBusAware, SecurityManager, SessionManager, org.apache.shiro.util.Destroyable
    Direct Known Subclasses:
    AuthorizingSecurityManager

    public abstract class AuthenticatingSecurityManager
    extends RealmSecurityManager
    Shiro support of a SecurityManager class hierarchy that delegates all authentication operations to a wrapped Authenticator instance. That is, this class implements all the Authenticator methods in the SecurityManager interface, but in reality, those methods are merely passthrough calls to the underlying 'real' Authenticator instance.

    All other SecurityManager (authorization, session, etc) methods are left to be implemented by subclasses.

    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.

    Since:
    0.9
    • Constructor Detail

      • AuthenticatingSecurityManager

        public AuthenticatingSecurityManager()
        Default no-arg constructor that initializes its internal authenticator instance to a ModularRealmAuthenticator.
    • Method Detail

      • getAuthenticator

        public Authenticator getAuthenticator()
        Returns the delegate Authenticator instance that this SecurityManager uses to perform all authentication operations. Unless overridden by the setAuthenticator, the default instance is a ModularRealmAuthenticator.
        Returns:
        the delegate Authenticator instance that this SecurityManager uses to perform all authentication operations.
      • setAuthenticator

        public void setAuthenticator​(Authenticator authenticator)
                              throws 
        Sets the delegate Authenticator instance that this SecurityManager uses to perform all authentication operations. Unless overridden by this method, the default instance is a ModularRealmAuthenticator.
        Parameters:
        authenticator - the delegate Authenticator instance that this SecurityManager will use to perform all authentication operations.
        Throws:
        - if the argument is null.
      • afterRealmsSet

        protected void afterRealmsSet()
        Passes on the realms to the internal delegate Authenticator instance so that it may use them during authentication attempts.
        Overrides:
        afterRealmsSet in class RealmSecurityManager