|
Apache Tomcat 7.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.realm.RealmBase
org.apache.catalina.realm.MemoryRealm
org.apache.catalina.realm.JAASMemoryLoginModule
public class JAASMemoryLoginModule
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
(except that digested passwords are not supported).
This class recognizes the following string-valued options, which are
specified in the configuration file (and passed to our constructor in
the options argument:
false.MemoryRealm. The default value matches the MemoryRealm
default.IMPLEMENTATION NOTE - This class implements
Realm only to satisfy the calling requirements of the
GenericPrincipal constructor. It does not actually perform
the functionality required of a Realm implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.catalina.realm.RealmBase |
|---|
RealmBase.AllRolesMode |
| Field Summary | |
|---|---|
protected CallbackHandler |
callbackHandler
The callback handler responsible for answering our requests. |
protected boolean |
committed
Has our own commit() returned successfully? |
protected Map<String,?> |
options
The configuration information for this LoginModule. |
protected String |
pathname
The absolute or relative pathname to the XML configuration file. |
protected Principal |
principal
The Principal identified by our validation, or
null if validation failed. |
protected Map<String,?> |
sharedState
The state information that is shared with other configured LoginModule instances. |
protected Subject |
subject
The subject for which we are performing authentication. |
| Fields inherited from class org.apache.catalina.realm.MemoryRealm |
|---|
info, name |
| Fields inherited from class org.apache.catalina.realm.RealmBase |
|---|
allRolesMode, container, containerLog, digest, digestEncoding, md, md5Encoder, md5Helper, realmPath, sm, support, validate |
| Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase |
|---|
mserver |
| Fields inherited from interface org.apache.catalina.Lifecycle |
|---|
AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, DESTROY_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT |
| Constructor Summary | |
|---|---|
JAASMemoryLoginModule()
|
|
| Method Summary | |
|---|---|
boolean |
abort()
Phase 2 of authenticating a Subject when Phase 1
fails. |
boolean |
commit()
Phase 2 of authenticating a Subject when Phase 1
was successful. |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options)
Initialize this LoginModule with the specified
configuration information. |
protected void |
load()
Load the contents of our configuration file. |
boolean |
login()
Phase 1 of authenticating a Subject. |
boolean |
logout()
Log out this user. |
| Methods inherited from class org.apache.catalina.realm.MemoryRealm |
|---|
authenticate, getDigester, getInfo, getName, getPassword, getPathname, getPrincipal, getPrincipals, setPathname, startInternal |
| Methods inherited from class org.apache.catalina.realm.RealmBase |
|---|
addPropertyChangeListener, authenticate, authenticate, backgroundProcess, digest, Digest, findSecurityConstraints, getAllRolesMode, getContainer, getDigest, getDigest, getDigestEncoding, getDomainInternal, getObjectNameKeyProperties, getPrincipal, getRealmPath, getRealmSuffix, getServer, getValidate, hasMessageDigest, hasResourcePermission, hasRole, hasUserDataPermission, initInternal, main, removePropertyChangeListener, setAllRolesMode, setContainer, setDigest, setDigestEncoding, setRealmPath, setValidate, stopInternal, toString |
| Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase |
|---|
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister |
| Methods inherited from class org.apache.catalina.util.LifecycleBase |
|---|
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected CallbackHandler callbackHandler
protected boolean committed
commit() returned successfully?
protected Map<String,?> options
LoginModule.
protected String pathname
protected Principal principal
Principal identified by our validation, or
null if validation failed.
protected Map<String,?> sharedState
LoginModule instances.
protected Subject subject
| Constructor Detail |
|---|
public JAASMemoryLoginModule()
| Method Detail |
|---|
public boolean abort()
throws LoginException
Subject when Phase 1
fails. This method is called if the LoginContext
failed somewhere in the overall authentication chain.
abort in interface LoginModuletrue if this method succeeded, or
false if this LoginModule should be
ignored
LoginException - if the abort fails
public boolean commit()
throws LoginException
Subject when Phase 1
was successful. This method is called if the LoginContext
succeeded in the overall authentication chain.
commit in interface LoginModuletrue if the authentication succeeded, or
false if this LoginModule should be
ignored
LoginException - if the commit fails
public void initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options)
LoginModule with the specified
configuration information.
initialize in interface LoginModulesubject - The Subject to be authenticatedcallbackHandler - A CallbackHandler for communicating
with the end user as necessarysharedState - State information shared with other
LoginModule instancesoptions - Configuration information for this specific
LoginModule instance
public boolean login()
throws LoginException
Subject.
login in interface LoginModuletrue if the authentication succeeded, or
false if this LoginModule should be
ignored
LoginException - if the authentication fails
public boolean logout()
throws LoginException
logout in interface LoginModuletrue in all cases because the
LoginModule should not be ignored
LoginException - if logging out failedprotected void load()
|
Apache Tomcat 7.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||