|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.realm.RealmBase
org.apache.catalina.realm.MemoryRealm
org.apache.catalina.realm.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.
Field Summary | |
protected javax.security.auth.callback.CallbackHandler |
callbackHandler
The callback handler responsible for answering our requests. |
protected boolean |
committed
Has our own commit() returned successfully? |
protected boolean |
debug
Should we log debugging messages? |
protected java.lang.String |
info
Descriptive information about this Realm implementation. |
protected java.util.Map |
options
The configuration information for this LoginModule . |
protected java.lang.String |
pathname
The absolute or relative pathname to the XML configuration file. |
protected java.security.Principal |
principal
The Principal identified by our validation, or
null if validation falied. |
protected java.util.HashMap |
principals
The set of Principals loaded from our configuration file. |
protected java.util.Map |
sharedState
The state information that is shared with other configured LoginModule instances. |
protected javax.security.auth.Subject |
subject
The subject for which we are performing authentication. |
Fields inherited from class org.apache.catalina.realm.MemoryRealm |
name |
Fields inherited from class org.apache.catalina.realm.RealmBase |
container, digest, digestEncoding, lifecycle, md, md5Encoder, md5Helper, started, support, validate |
Fields inherited from interface org.apache.catalina.Lifecycle |
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_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. |
java.lang.String |
getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version> . |
void |
initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map sharedState,
java.util.Map 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, getName, getPassword, getPathname, getPrincipal, setPathname, start, stop |
Methods inherited from class org.apache.catalina.realm.RealmBase |
addLifecycleListener, addPropertyChangeListener, authenticate, authenticate, authenticate, digest, Digest, findLifecycleListeners, getContainer, getDebug, getDigest, getDigest, getDigestEncoding, getPrincipal, getValidate, hasMessageDigest, hasRole, log, log, main, removeLifecycleListener, removePropertyChangeListener, setContainer, setDebug, setDigest, setDigestEncoding, setValidate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final java.lang.String info
protected javax.security.auth.callback.CallbackHandler callbackHandler
protected boolean committed
commit()
returned successfully?
protected boolean debug
protected java.util.Map options
LoginModule
.
protected java.lang.String pathname
protected java.security.Principal principal
Principal
identified by our validation, or
null
if validation falied.
protected java.util.HashMap principals
Principals
loaded from our configuration file.
protected java.util.Map sharedState
LoginModule
instances.
protected javax.security.auth.Subject subject
Constructor Detail |
public JAASMemoryLoginModule()
Method Detail |
public boolean abort() throws javax.security.auth.login.LoginException
Subject
when Phase 1
fails. This method is called if the LoginContext
failed somewhere in the overall authentication chain.
abort
in interface javax.security.auth.spi.LoginModule
true
if this method succeeded, or
false
if this LoginModule
should be
ignored
javax.security.auth.login.LoginException
- if the abort failspublic boolean commit() throws javax.security.auth.login.LoginException
Subject
when Phase 1
was successful. This method is called if the LoginContext
succeeded in the overall authentication chain.
commit
in interface javax.security.auth.spi.LoginModule
true
if the authentication succeeded, or
false
if this LoginModule
should be
ignored
javax.security.auth.login.LoginException
- if the commit failspublic void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map sharedState, java.util.Map options)
LoginModule
with the specified
configuration information.
initialize
in interface javax.security.auth.spi.LoginModule
subject
- 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
instancepublic boolean login() throws javax.security.auth.login.LoginException
Subject
.
login
in interface javax.security.auth.spi.LoginModule
true
if the authentication succeeded, or
false
if this LoginModule
should be
ignored
javax.security.auth.login.LoginException
- if the authentication failspublic boolean logout() throws javax.security.auth.login.LoginException
logout
in interface javax.security.auth.spi.LoginModule
true
in all cases because thie
LoginModule
should not be ignored
javax.security.auth.login.LoginException
- if logging out failedpublic java.lang.String getInfo()
<description>/<version>
.
getInfo
in interface Realm
getInfo
in class MemoryRealm
protected void load()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |