| java.lang.Object org.apache.catalina.realm.RealmBase org.apache.catalina.realm.MemoryRealm org.apache.catalina.realm.JAASMemoryLoginModule
JAASMemoryLoginModule | public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule,Realm(Code) | | 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:
- debug - Set to "true" to get debugging messages
generated to System.out. The default value is
false .
- pathname - Relative (to the pathname specified by the
"catalina.base" system property) or absolute pahtname to the
XML file containing our user information, in the format supported by
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.
author: Craig R. McClanahan version: $Revision: 1.7 $ $Date: 2004/02/27 14:58:45 $ |
Field Summary | |
protected CallbackHandler | callbackHandler The callback handler responsible for answering our requests. | protected boolean | committed | protected boolean | debug | 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. |
Method Summary | |
public boolean | abort() Phase 2 of authenticating a Subject when Phase 1
fails. | public boolean | commit() Phase 2 of authenticating a Subject when Phase 1
was successful. | public SecurityConstraint[] | findSecurityConstraints(HttpRequest request, Context context) Return the SecurityConstraints configured to guard the request URI for
this request, or null if there is no such constraint. | public 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. | public boolean | login() Phase 1 of authenticating a Subject . | public boolean | logout() Log out this user. |
callbackHandler | protected CallbackHandler callbackHandler(Code) | | The callback handler responsible for answering our requests.
|
committed | protected boolean committed(Code) | | Has our own commit() returned successfully?
|
debug | protected boolean debug(Code) | | Should we log debugging messages?
|
options | protected Map options(Code) | | The configuration information for this LoginModule .
|
pathname | protected String pathname(Code) | | The absolute or relative pathname to the XML configuration file.
|
principal | protected Principal principal(Code) | | The Principal identified by our validation, or
null if validation falied.
|
principals | protected HashMap principals(Code) | | The set of Principals loaded from our configuration file.
|
sharedState | protected Map sharedState(Code) | | The state information that is shared with other configured
LoginModule instances.
|
subject | protected Subject subject(Code) | | The subject for which we are performing authentication.
|
JAASMemoryLoginModule | public JAASMemoryLoginModule()(Code) | | |
abort | public boolean abort() throws LoginException(Code) | | Phase 2 of authenticating a Subject when Phase 1
fails. This method is called if the LoginContext
failed somewhere in the overall authentication chain.
true if this method succeeded, orfalse if this LoginModule should beignored exception: LoginException - if the abort fails |
commit | public boolean commit() throws LoginException(Code) | | Phase 2 of authenticating a Subject when Phase 1
was successful. This method is called if the LoginContext
succeeded in the overall authentication chain.
true if the authentication succeeded, orfalse if this LoginModule should beignored exception: LoginException - if the commit fails |
findSecurityConstraints | public SecurityConstraint[] findSecurityConstraints(HttpRequest request, Context context)(Code) | | Return the SecurityConstraints configured to guard the request URI for
this request, or null if there is no such constraint.
Parameters: request - Request we are processing Parameters: context - Context the Request is mapped to |
initialize | public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)(Code) | | Initialize this LoginModule with the specified
configuration information.
Parameters: subject - The Subject to be authenticated Parameters: callbackHandler - A CallbackHandler for communicatingwith the end user as necessary Parameters: sharedState - State information shared with otherLoginModule instances Parameters: options - Configuration information for this specificLoginModule instance |
load | protected void load()(Code) | | Load the contents of our configuration file.
|
login | public boolean login() throws LoginException(Code) | | Phase 1 of authenticating a Subject .
true if the authentication succeeded, orfalse if this LoginModule should beignored exception: LoginException - if the authentication fails |
logout | public boolean logout() throws LoginException(Code) | | Log out this user.
true in all cases because thieLoginModule should not be ignored exception: LoginException - if logging out failed |
Methods inherited from org.apache.catalina.realm.RealmBase | final public static String Digest(String credentials, String algorithm)(Code)(Java Doc) public void addLifecycleListener(LifecycleListener listener)(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public Principal authenticate(String username, String credentials)(Code)(Java Doc) public Principal authenticate(String username, byte[] credentials)(Code)(Java Doc) public Principal authenticate(String username, String clientDigest, String nOnce, String nc, String cnonce, String qop, String realm, String md5a2)(Code)(Java Doc) public Principal authenticate(X509Certificate certs)(Code)(Java Doc) public void destroy()(Code)(Java Doc) protected String digest(String credentials)(Code)(Java Doc) public LifecycleListener[] findLifecycleListeners()(Code)(Java Doc) public SecurityConstraint[] findSecurityConstraints(HttpRequest request, Context context)(Code)(Java Doc) public Container getContainer()(Code)(Java Doc) public ObjectName getController()(Code)(Java Doc) public int getDebug()(Code)(Java Doc) public String getDigest()(Code)(Java Doc) protected String getDigest(String username, String realmName)(Code)(Java Doc) public String getDomain()(Code)(Java Doc) public String getInfo()(Code)(Java Doc) abstract protected String getName()(Code)(Java Doc) public ObjectName getObjectName()(Code)(Java Doc) abstract protected String getPassword(String username)(Code)(Java Doc) abstract protected Principal getPrincipal(String username)(Code)(Java Doc) public String getType()(Code)(Java Doc) public boolean getValidate()(Code)(Java Doc) protected boolean hasMessageDigest()(Code)(Java Doc) public boolean hasResourcePermission(HttpRequest request, HttpResponse response, SecurityConstraint[] constraints, Context context) throws IOException(Code)(Java Doc) public boolean hasRole(Principal principal, String role)(Code)(Java Doc) public boolean hasUserDataPermission(HttpRequest request, HttpResponse response, SecurityConstraint[] constraints) throws IOException(Code)(Java Doc) public void init()(Code)(Java Doc) protected void log(String message)(Code)(Java Doc) protected void log(String message, Throwable throwable)(Code)(Java Doc) public static void main(String args)(Code)(Java Doc) public void postDeregister()(Code)(Java Doc) public void postRegister(Boolean registrationDone)(Code)(Java Doc) public void preDeregister() throws Exception(Code)(Java Doc) public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code)(Java Doc) public void removeLifecycleListener(LifecycleListener listener)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void setContainer(Container container)(Code)(Java Doc) public void setController(ObjectName controller)(Code)(Java Doc) public void setDebug(int debug)(Code)(Java Doc) public void setDigest(String digest)(Code)(Java Doc) public void setValidate(boolean validate)(Code)(Java Doc) public void start() throws LifecycleException(Code)(Java Doc) public void stop() throws LifecycleException(Code)(Java Doc)
|
|
|