Class AuthSubsystem
- java.lang.Object
-
- com.netscape.cmscore.authentication.AuthSubsystem
-
- All Implemented Interfaces:
ISubsystem,IAuthSubsystem
public class AuthSubsystem extends java.lang.Object implements IAuthSubsystem
Default authentication subsystem- Version:
- $Revision$, $Date$
- Author:
- cfu, lhsiao
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringIDstatic org.slf4j.Loggerloggerjava.util.Hashtable<java.lang.String,AuthManagerProxy>mAuthMgrInstsjava.util.Hashtable<java.lang.String,AuthMgrPlugin>mAuthMgrPlugins-
Fields inherited from interface org.dogtagpki.server.authentication.IAuthSubsystem
CERTUSERDB_AUTHMGR_ID, CERTUSERDB_PLUGIN_ID, CHALLENGE_AUTHMGR_ID, CHALLENGE_PLUGIN_ID, CMC_USER_SIGNED_AUTH_AUTHMGR_ID, CMCAUTH_AUTHMGR_ID, CMCAUTH_PLUGIN_ID, NULL_AUTHMGR_ID, NULL_PLUGIN_ID, PASSWDUSERDB_AUTHMGR_ID, PASSWDUSERDB_PLUGIN_ID, PROP_CLASS, PROP_IMPL, PROP_PLUGIN, SSLCLIENTCERT_AUTHMGR_ID, SSLCLIENTCERT_PLUGIN_ID
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String name, IAuthManager authMgrInst)Add an authentication manager instance.IAuthTokenauthenticate(IAuthCredentials authCred, java.lang.String authMgrInstName)Authenticate to the named authentication manager instancevoiddelete(java.lang.String name)Deletes (deregisters) the given authentication manager.IAuthManagerget(java.lang.String name)Gets the authentication manager instance of the specified name.IAuthManagergetAuthManager(java.lang.String name)gets the named authentication managerIAuthManagergetAuthManagerPlugin(java.lang.String name)Retrieve a single auth manager instanceAuthMgrPlugingetAuthManagerPluginImpl(java.lang.String name)retrieve a single auth manager plugin by namejava.util.Enumeration<AuthMgrPlugin>getAuthManagerPlugins()Enumerate all registered authentication manager plugins.java.util.Enumeration<IAuthManager>getAuthManagers()Enumerate all authentication manager instances.java.lang.String[]getConfigParams(java.lang.String implName)Gets configuration parameters for the given authentication manager plugin.AuthenticationConfiggetConfigStore()Returns the root configuration storage of this system.java.lang.StringgetId()Retrieves id (name) of this subsystem.static AuthSubsystemgetInstance()java.util.Hashtable<java.lang.String,AuthManagerProxy>getInstances()Get a hashtable containing all authentication instances.java.util.Hashtable<java.lang.String,AuthMgrPlugin>getPlugins()Get a hashtable containing all authentication plugins.java.lang.String[]getRequiredCreds(java.lang.String authMgrInstName)Gets a list of required authentication credential names of the specified authentication manager.voidinit(IConfigStore config)Initializes the authentication subsystem from the config store.voidsetId(java.lang.String id)Sets id string to this subsystem.voidshutdown()shuts down authentication managers one by one.voidstartup()registers the administration servlet with the administration subsystem.
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
mAuthMgrPlugins
public java.util.Hashtable<java.lang.String,AuthMgrPlugin> mAuthMgrPlugins
-
mAuthMgrInsts
public java.util.Hashtable<java.lang.String,AuthManagerProxy> mAuthMgrInsts
-
-
Method Detail
-
getInstance
public static AuthSubsystem getInstance()
-
init
public void init(IConfigStore config) throws EBaseException
Initializes the authentication subsystem from the config store. Load Authentication manager plugins, create and initialize initialize authentication manager instances.- Specified by:
initin interfaceISubsystem- Parameters:
config- The configuration store.- Throws:
EBaseException- failed to initialize
-
authenticate
public IAuthToken authenticate(IAuthCredentials authCred, java.lang.String authMgrInstName) throws EMissingCredential, EInvalidCredentials, EAuthMgrNotFound, EBaseException
Authenticate to the named authentication manager instance- Specified by:
authenticatein interfaceIAuthSubsystem- Parameters:
authCred- authentication credentials subject to the requirements of each authentication managerauthMgrName- 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
public java.lang.String[] getRequiredCreds(java.lang.String authMgrInstName) throws EAuthMgrNotFoundGets a list of required authentication credential names of the specified authentication manager.- Specified by:
getRequiredCredsin interfaceIAuthSubsystem- Parameters:
authMgrInstName- The authentication manager name- Returns:
- a Vector of required credential attribute names.
- Throws:
EAuthMgrNotFound
-
getConfigParams
public java.lang.String[] getConfigParams(java.lang.String implName) throws EAuthMgrPluginNotFound, EBaseExceptionGets configuration parameters for the given authentication manager plugin.- Specified by:
getConfigParamsin interfaceIAuthSubsystem- Parameters:
implName- Name of the authentication plugin.- Returns:
- Hashtable of required parameters.
- Throws:
EAuthMgrPluginNotFound- If the authentication manager plugin is not found.EBaseException- If an internal error occurred.
-
add
public void add(java.lang.String name, IAuthManager authMgrInst)Add an authentication manager instance.- Specified by:
addin interfaceIAuthSubsystem- Parameters:
name- name of the authentication manager instanceauthMgr- the authentication manager instance to be added
-
delete
public void delete(java.lang.String name)
Description copied from interface:IAuthSubsystemDeletes (deregisters) the given authentication manager.- Specified by:
deletein interfaceIAuthSubsystem- Parameters:
name- The authentication manager name to delete.
-
get
public IAuthManager get(java.lang.String name)
Gets the authentication manager instance of the specified name.- Specified by:
getin interfaceIAuthSubsystem- Parameters:
name- name of the authentication manager instance- Returns:
- the named authentication manager instance
-
getAuthManagers
public java.util.Enumeration<IAuthManager> getAuthManagers()
Enumerate all authentication manager instances.- Specified by:
getAuthManagersin interfaceIAuthSubsystem- Returns:
- a list of authentication managers
-
getAuthManagerPlugins
public java.util.Enumeration<AuthMgrPlugin> getAuthManagerPlugins()
Enumerate all registered authentication manager plugins.- Specified by:
getAuthManagerPluginsin interfaceIAuthSubsystem- Returns:
- a list of authentication plugins
-
getAuthManagerPluginImpl
public AuthMgrPlugin getAuthManagerPluginImpl(java.lang.String name)
retrieve a single auth manager plugin by name- Specified by:
getAuthManagerPluginImplin interfaceIAuthSubsystem- Parameters:
name- given authentication manager name.- Returns:
- an authentication manager plugin
-
getAuthManagerPlugin
public IAuthManager getAuthManagerPlugin(java.lang.String name)
Retrieve a single auth manager instance- Specified by:
getAuthManagerPluginin interfaceIAuthSubsystem- Parameters:
name- given authentication plugin name- Returns:
- the given authentication plugin
-
getId
public java.lang.String getId()
Retrieves id (name) of this subsystem.- Specified by:
getIdin interfaceISubsystem- Returns:
- name of the authentication subsystem
-
setId
public void setId(java.lang.String id) throws EBaseExceptionSets id string to this subsystem.Use with caution. Should not do it when sharing with others
- Specified by:
setIdin interfaceISubsystem- Parameters:
id- name to be applied to an authentication sybsystem- Throws:
EBaseException- failed to set id
-
startup
public void startup() throws EBaseExceptionregisters the administration servlet with the administration subsystem.- Specified by:
startupin interfaceISubsystem- Throws:
EBaseException- failed to start up
-
shutdown
public void shutdown()
shuts down authentication managers one by one.- Specified by:
shutdownin interfaceISubsystem
-
getPlugins
public java.util.Hashtable<java.lang.String,AuthMgrPlugin> getPlugins()
Description copied from interface:IAuthSubsystemGet a hashtable containing all authentication plugins.- Specified by:
getPluginsin interfaceIAuthSubsystem- Returns:
- all authentication plugins.
-
getInstances
public java.util.Hashtable<java.lang.String,AuthManagerProxy> getInstances()
Description copied from interface:IAuthSubsystemGet a hashtable containing all authentication instances.- Specified by:
getInstancesin interfaceIAuthSubsystem- Returns:
- all authentication instances.
-
getConfigStore
public AuthenticationConfig getConfigStore()
Returns the root configuration storage of this system.- Specified by:
getConfigStorein interfaceISubsystem- Returns:
- configuration store of this subsystem
-
getAuthManager
public IAuthManager getAuthManager(java.lang.String name)
gets the named authentication manager- Specified by:
getAuthManagerin interfaceIAuthSubsystem- Parameters:
name- of the authentication manager- Returns:
- the named authentication manager
-
-