Class AuthSubsystem

java.lang.Object
com.netscape.cmscore.authentication.AuthSubsystem
All Implemented Interfaces:
ISubsystem

public class AuthSubsystem extends Object implements ISubsystem
Default authentication subsystem

Version:
$Revision$, $Date$
Author:
cfu, lhsiao
  • Field Details

  • Constructor Details

    • AuthSubsystem

      public AuthSubsystem()
  • Method Details

    • loadAuthManagerPlugins

      public void loadAuthManagerPlugins() throws EBaseException
      Throws:
      EBaseException
    • loadAuthManagerInstances

      public void loadAuthManagerInstances() throws EBaseException
      Throws:
      EBaseException
    • init

      public void init(ConfigStore config) throws EBaseException
      Initializes the authentication subsystem from the config store. Load Authentication manager plugins, create and initialize initialize authentication manager instances.
      Specified by:
      init in interface ISubsystem
      Parameters:
      config - The configuration store.
      Throws:
      EBaseException
    • authenticate

      public IAuthToken authenticate(IAuthCredentials authCred, String authMgrInstName) throws EMissingCredential, EInvalidCredentials, EAuthMgrNotFound, EBaseException
      Authenticate to the named authentication manager instance

      Parameters:
      authCred - authentication credentials subject to the requirements of each authentication manager
      authMgrInstName - name of the authentication manager instance
      Returns:
      authentication token with individualized authenticated information.
      Throws:
      EMissingCredential - If a required credential for the authentication manager is missing.
      EInvalidCredentials - If the credentials cannot be authenticated
      EAuthMgrNotFound - The auth manager is not found.
      EBaseException - If an internal error occurred.
    • getRequiredCreds

      public String[] getRequiredCreds(String authMgrInstName) throws EAuthMgrNotFound
      Gets a list of required authentication credential names of the specified authentication manager.
      Parameters:
      authMgrInstName - The authentication manager name
      Returns:
      a Vector of required credential attribute names.
      Throws:
      EAuthMgrNotFound
    • getConfigParams

      public String[] getConfigParams(String implName) throws EAuthMgrPluginNotFound, EBaseException
      Gets configuration parameters for the given authentication manager plugin.
      Parameters:
      implName - Name of the authentication plugin.
      Returns:
      Hashtable of required parameters.
      Throws:
      EAuthMgrPluginNotFound
      EBaseException
    • add

      public void add(String name, AuthManager authMgrInst)
      Add an authentication manager instance.
      Parameters:
      name - name of the authentication manager instance
      authMgrInst - the authentication manager instance to be added
    • delete

      public void delete(String name)
      Removes a authentication manager instance.
      Parameters:
      name - name of the authentication manager
    • get

      public AuthManager get(String name)
      Gets the authentication manager instance of the specified name.
      Parameters:
      name - name of the authentication manager instance
      Returns:
      the named authentication manager instance
    • getAuthManagers

      public Enumeration<AuthManager> getAuthManagers()
      Enumerate all authentication manager instances.
    • getAuthManagerPlugins

      public Enumeration<AuthMgrPlugin> getAuthManagerPlugins()
      Enumerate all registered authentication manager plugins.
    • getAuthManagerPluginImpl

      public AuthMgrPlugin getAuthManagerPluginImpl(String name)
      retrieve a single auth manager plugin by name
    • getAuthManagerPlugin

      public AuthManager getAuthManagerPlugin(String name)
      Retrieve a single auth manager instance
    • getId

      public String getId()
      Retrieves id (name) of this subsystem.
      Specified by:
      getId in interface ISubsystem
      Returns:
      name of the authentication subsystem
    • setId

      public void setId(String id) throws EBaseException
      Sets id string to this subsystem.

      Use with caution. Should not do it when sharing with others

      Specified by:
      setId in interface ISubsystem
      Parameters:
      id - name to be applied to an authentication sybsystem
      Throws:
      EBaseException - failed to set id
    • startup

      public void startup() throws EBaseException
      registers the administration servlet with the administration subsystem.
      Specified by:
      startup in interface ISubsystem
      Throws:
      EBaseException - failed to start up
    • shutdown

      public void shutdown()
      shuts down authentication managers one by one.

      Specified by:
      shutdown in interface ISubsystem
    • getPlugins

      public Hashtable<String,AuthMgrPlugin> getPlugins()
      Get a hashtable containing all authentication plugins.
      Returns:
      all authentication plugins.
    • getInstances

      public Hashtable<String,AuthManagerProxy> getInstances()
      Get a hashtable containing all authentication instances.
      Returns:
      all authentication instances.
    • getConfigStore

      public AuthenticationConfig getConfigStore()
      Returns the root configuration storage of this system.
      Specified by:
      getConfigStore in interface ISubsystem
      Returns:
      configuration store of this subsystem
    • getAuthManager

      public AuthManager getAuthManager(String name)
      gets the named authentication manager
      Parameters:
      name - of the authentication manager
      Returns:
      the named authentication manager