org.apache.catalina.realm
public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule, Realm
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.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.
Version: $Revision: 692717 $ $Date: 2008-09-06 21:52:56 +0200 (Sat, 06 Sep 2008) $
| Field Summary | |
|---|---|
| protected CallbackHandler | callbackHandler
The callback handler responsible for answering our requests. |
| protected boolean | committed
Has our own commit() returned successfully? |
| protected Map | 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 falied. |
| protected HashMap | principals
The set of Principals loaded from our configuration file. |
| protected Map | sharedState
The state information that is shared with other configured
LoginModule instances. |
| protected static StringManager | sm
The string manager for this package. |
| protected Subject | subject
The subject for which we are performing authentication. |
| 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. |
| SecurityConstraint[] | findSecurityConstraints(Request request, Context context)
Return the SecurityConstraints configured to guard the request URI for
this request, or null if there is no such constraint.
|
| void | initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, 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.
|
commit() returned successfully?LoginModule.Principal identified by our validation, or
null if validation falied.Principals loaded from our configuration file.LoginModule instances.Subject when Phase 1
fails. This method is called if the LoginContext
failed somewhere in the overall authentication chain.
Returns: true if this method succeeded, or
false if this LoginModule should be
ignored
Throws: LoginException if the abort fails
Subject when Phase 1
was successful. This method is called if the LoginContext
succeeded in the overall authentication chain.
Returns: true if the authentication succeeded, or
false if this LoginModule should be
ignored
Throws: LoginException if the commit fails
null if there is no such constraint.
Parameters: request Request we are processing context Context the Request is mapped to
LoginModule with the specified
configuration information.
Parameters: subject The Subject to be authenticated callbackHandler A CallbackHandler for communicating
with the end user as necessary sharedState State information shared with other
LoginModule instances options Configuration information for this specific
LoginModule instance
Subject.
Returns: true if the authentication succeeded, or
false if this LoginModule should be
ignored
Throws: LoginException if the authentication fails
Returns: true in all cases because thie
LoginModule should not be ignored
Throws: LoginException if logging out failed