Class AuthSubsystem
java.lang.Object
com.netscape.cmscore.authentication.AuthSubsystem
- All Implemented Interfaces:
ISubsystem
Default authentication subsystem
- Version:
- $Revision$, $Date$
- Author:
- cfu, lhsiao
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Constant for certificate based authentication manager ID.static final String
Constant for certificate based authentication plugin ID.static final String
Constant for challenge based authentication manager ID.static final String
Constant for challenge based authentication plugin ID.static final String
Constant for CMC user-signed authentication manager ID.static final String
Constant for CMC authentication manager ID.static final String
Constant for CMC authentication plugin ID.static final String
static org.slf4j.Logger
static final String
Constant for null authentication manager ID.static final String
Constant for null authentication plugin ID.static final String
Constant for password based authentication manager ID.static final String
Constant for password based authentication plugin ID.static final String
static final String
static final String
static final String
Constant for ssl client authentication manager ID.static final String
Constant for ssl client authentication plugin ID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String name, AuthManager authMgrInst) Add an authentication manager instance.authenticate
(IAuthCredentials authCred, String authMgrInstName) Authenticate to the named authentication manager instancevoid
Removes a authentication manager instance.Gets the authentication manager instance of the specified name.getAuthManager
(String name) gets the named authentication managergetAuthManagerPlugin
(String name) Retrieve a single auth manager instanceretrieve a single auth manager plugin by nameEnumerate all registered authentication manager plugins.Enumerate all authentication manager instances.String[]
getConfigParams
(String implName) Gets configuration parameters for the given authentication manager plugin.Returns the root configuration storage of this system.getId()
Retrieves id (name) of this subsystem.Get a hashtable containing all authentication instances.Get a hashtable containing all authentication plugins.String[]
getRequiredCreds
(String authMgrInstName) Gets a list of required authentication credential names of the specified authentication manager.void
init
(ConfigStore config) Initializes the authentication subsystem from the config store.void
void
void
Sets id string to this subsystem.void
shutdown()
shuts down authentication managers one by one.void
startup()
registers the administration servlet with the administration subsystem.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
ID
- See Also:
-
PROP_CLASS
- See Also:
-
PROP_IMPL
- See Also:
-
PROP_PLUGIN
- See Also:
-
PASSWDUSERDB_PLUGIN_ID
Constant for password based authentication plugin ID.- See Also:
-
CERTUSERDB_PLUGIN_ID
Constant for certificate based authentication plugin ID.- See Also:
-
CHALLENGE_PLUGIN_ID
Constant for challenge based authentication plugin ID.- See Also:
-
NULL_PLUGIN_ID
Constant for null authentication plugin ID.- See Also:
-
SSLCLIENTCERT_PLUGIN_ID
Constant for ssl client authentication plugin ID.- See Also:
-
PASSWDUSERDB_AUTHMGR_ID
Constant for password based authentication manager ID.- See Also:
-
CERTUSERDB_AUTHMGR_ID
Constant for certificate based authentication manager ID.- See Also:
-
CHALLENGE_AUTHMGR_ID
Constant for challenge based authentication manager ID.- See Also:
-
NULL_AUTHMGR_ID
Constant for null authentication manager ID.- See Also:
-
SSLCLIENTCERT_AUTHMGR_ID
Constant for ssl client authentication manager ID.- See Also:
-
CMCAUTH_PLUGIN_ID
Constant for CMC authentication plugin ID.- See Also:
-
CMCAUTH_AUTHMGR_ID
Constant for CMC authentication manager ID.- See Also:
-
CMC_USER_SIGNED_AUTH_AUTHMGR_ID
Constant for CMC user-signed authentication manager ID.- See Also:
-
mAuthMgrPlugins
-
mAuthMgrInsts
-
-
Constructor Details
-
AuthSubsystem
public AuthSubsystem()
-
-
Method Details
-
loadAuthManagerPlugins
- Throws:
EBaseException
-
loadAuthManagerInstances
- Throws:
EBaseException
-
init
Initializes the authentication subsystem from the config store. Load Authentication manager plugins, create and initialize initialize authentication manager instances.- Specified by:
init
in interfaceISubsystem
- 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 managerauthMgrInstName
- 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 authenticatedEAuthMgrNotFound
- The auth manager is not found.EBaseException
- If an internal error occurred.
-
getRequiredCreds
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
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
Add an authentication manager instance.- Parameters:
name
- name of the authentication manager instanceauthMgrInst
- the authentication manager instance to be added
-
delete
Removes a authentication manager instance.- Parameters:
name
- name of the authentication manager
-
get
Gets the authentication manager instance of the specified name.- Parameters:
name
- name of the authentication manager instance- Returns:
- the named authentication manager instance
-
getAuthManagers
Enumerate all authentication manager instances. -
getAuthManagerPlugins
Enumerate all registered authentication manager plugins. -
getAuthManagerPluginImpl
retrieve a single auth manager plugin by name -
getAuthManagerPlugin
Retrieve a single auth manager instance -
getId
Retrieves id (name) of this subsystem.- Specified by:
getId
in interfaceISubsystem
- Returns:
- name of the authentication subsystem
-
setId
Sets id string to this subsystem.Use with caution. Should not do it when sharing with others
- Specified by:
setId
in interfaceISubsystem
- Parameters:
id
- name to be applied to an authentication sybsystem- Throws:
EBaseException
- failed to set id
-
startup
registers the administration servlet with the administration subsystem.- Specified by:
startup
in interfaceISubsystem
- Throws:
EBaseException
- failed to start up
-
shutdown
public void shutdown()shuts down authentication managers one by one.- Specified by:
shutdown
in interfaceISubsystem
-
getPlugins
Get a hashtable containing all authentication plugins.- Returns:
- all authentication plugins.
-
getInstances
Get a hashtable containing all authentication instances.- Returns:
- all authentication instances.
-
getConfigStore
Returns the root configuration storage of this system.- Specified by:
getConfigStore
in interfaceISubsystem
- Returns:
- configuration store of this subsystem
-
getAuthManager
gets the named authentication manager- Parameters:
name
- of the authentication manager- Returns:
- the named authentication manager
-