Class JAASMemoryLoginModule
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.realm.RealmBase
org.apache.catalina.realm.MemoryRealm
org.apache.catalina.realm.JAASMemoryLoginModule
- All Implemented Interfaces:
MBeanRegistration, LoginModule, Contained, JmxEnabled, Lifecycle, Realm
Deprecated.
This class will be removed in Tomcat 12.
Implementation of the JAAS LoginModule interface, primarily for use in testing
JAASRealm. It utilizes an XML-format data file of username/password/role information identical to that
supported by org.apache.catalina.realm.MemoryRealm.
This class recognizes the following string-valued options, which are specified in the configuration file and passed
to initialize(Subject, CallbackHandler, Map, Map) in the options argument:
- pathname - Relative (to the pathname specified by the "catalina.base" system property) or
absolute pathname to the XML file containing our user information, in the format supported by
MemoryRealm. The default value matches the MemoryRealm default. - credentialHandlerClassName - The fully qualified class name of the CredentialHandler to use. If
not specified,
MessageDigestCredentialHandlerwill be used. - Any additional options will be used to identify and call setters on the
CredentialHandler. For example,algorithm=SHA256would result in a call toMessageDigestCredentialHandler.setAlgorithm(String)with a parameter of"SHA256"
IMPLEMENTATION NOTE - This class extends MemoryRealm rather than implementing
Realm directly, so that user lookup and credential validation are performed against the XML file
configured for the memory realm.
-
Nested Class Summary
Nested classes/interfaces inherited from class RealmBase
RealmBase.AllRolesModeNested classes/interfaces inherited from interface Lifecycle
Lifecycle.SingleUse -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CallbackHandlerDeprecated.The callback handler responsible for answering our requests.protected booleanDeprecated.Has our owncommit()returned successfully?Deprecated.The configuration information for thisLoginModule.protected StringDeprecated.The absolute or relative pathname to the XML configuration file.protected PrincipalDeprecated.ThePrincipalidentified by our validation, ornullif validation failed.Deprecated.ThePrincipalfor the roles.Deprecated.The state information that is shared with other configuredLoginModuleinstances.protected SubjectDeprecated.The subject for which we are performing authentication.Fields inherited from class RealmBase
allRolesMode, container, containerLog, realmPath, sm, stripRealmForGss, support, USER_ATTRIBUTES_DELIMITER, USER_ATTRIBUTES_WILDCARD, userAttributes, userAttributesList, validate, x509UsernameRetriever, x509UsernameRetrieverClassNameFields inherited from interface Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabort()Deprecated.booleancommit()Deprecated.voidinitialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) Deprecated.protected voidload()Deprecated.Load the contents of our configuration file.booleanlogin()Deprecated.booleanlogout()Deprecated.Methods inherited from class MemoryRealm
authenticate, getDigester, getPassword, getPathname, getPrincipal, setPathname, startInternalMethods inherited from class RealmBase
addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, authenticate, authenticate, backgroundProcess, findSecurityConstraints, getAllRolesMode, getContainer, getCredentialHandler, getDigest, getDigest, getDomainInternal, getObjectNameKeyProperties, getPrincipal, getPrincipal, getPrincipal, getRealmPath, getRealmSuffix, getServer, getTransportGuaranteeRedirectStatus, getUserAttributes, getValidate, getX509UsernameRetrieverClassName, hasMessageDigest, hasResourcePermission, hasRole, hasRoleInternal, hasUserDataPermission, initInternal, isStripRealmForGss, main, parseUserAttributes, removePropertyChangeListener, setAllRolesMode, setContainer, setCredentialHandler, setRealmPath, setStripRealmForGss, setTransportGuaranteeRedirectStatus, setUserAttributes, setValidate, setX509UsernameRetrieverClassName, stopInternal, toStringMethods inherited from class LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregisterMethods inherited from class LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Realm
isAvailable
-
Field Details
-
callbackHandler
Deprecated.The callback handler responsible for answering our requests. -
committed
protected boolean committedDeprecated.Has our owncommit()returned successfully? -
options
-
pathname
Deprecated.The absolute or relative pathname to the XML configuration file. -
principal
Deprecated.ThePrincipalidentified by our validation, ornullif validation failed. -
roles
-
subject
-
-
Constructor Details
-
JAASMemoryLoginModule
public JAASMemoryLoginModule()Deprecated.Constructs a new JAASMemoryLoginModule.
-
-
Method Details
-
abort
Deprecated.- Specified by:
abortin interfaceLoginModule- Throws:
LoginException
-
commit
Deprecated.- Specified by:
commitin interfaceLoginModule- Throws:
LoginException
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) Deprecated.- Specified by:
initializein interfaceLoginModule
-
login
Deprecated.- Specified by:
loginin interfaceLoginModule- Throws:
LoginException
-
logout
Deprecated.- Specified by:
logoutin interfaceLoginModule- Throws:
LoginException
-
load
protected void load()Deprecated.Load the contents of our configuration file.
-