| 
 | Apache Tomcat 6.0.53 | ||||||||
| 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
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  javax.security.auth.callback.CallbackHandler | callbackHandlerThe callback handler responsible for answering our requests. | 
| protected  boolean | committedHas our own commit()returned successfully? | 
| protected  java.util.Map | optionsThe configuration information for this LoginModule. | 
| protected  java.lang.String | pathnameThe absolute or relative pathname to the XML configuration file. | 
| protected  java.security.Principal | principalThe Principalidentified by our validation, ornullif validation falied. | 
| protected  java.util.HashMap | principalsThe set of Principalsloaded from our configuration file. | 
| protected  java.util.Map | sharedStateThe state information that is shared with other configured LoginModuleinstances. | 
| protected static StringManager | smThe string manager for this package. | 
| protected  javax.security.auth.Subject | subjectThe 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, controller, digest, digestEncoding, domain, host, initialized, lifecycle, md, md5Encoder, md5Helper, mserver, oname, path, realmPath, started, support, type, validate, x509UsernameRetriever, x509UsernameRetrieverClassName | 
| Fields inherited from interface org.apache.catalina.Lifecycle | 
|---|
| AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT | 
| Constructor Summary | |
|---|---|
| JAASMemoryLoginModule() | |
| Method Summary | |
|---|---|
|  boolean | abort()Phase 2 of authenticating a Subjectwhen Phase 1
 fails. | 
|  boolean | commit()Phase 2 of authenticating a Subjectwhen Phase 1
 was successful. | 
|  SecurityConstraint[] | findSecurityConstraints(Request request,
                        Context context)Return the SecurityConstraints configured to guard the request URI for this request, or nullif there is no such constraint. | 
|  void | initialize(javax.security.auth.Subject subject,
           javax.security.auth.callback.CallbackHandler callbackHandler,
           java.util.Map sharedState,
           java.util.Map options)Initialize this LoginModulewith 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, start, stop | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface org.apache.catalina.Realm | 
|---|
| addPropertyChangeListener, authenticate, authenticate, authenticate, authenticate, backgroundProcess, getContainer, getInfo, hasResourcePermission, hasRole, hasUserDataPermission, removePropertyChangeListener, setContainer | 
| Field Detail | 
|---|
protected javax.security.auth.callback.CallbackHandler callbackHandler
protected boolean committed
commit() returned successfully?
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 static StringManager sm
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.LoginModuletrue if this method succeeded, or
  false if this LoginModule should be
  ignored
javax.security.auth.login.LoginException - if the abort fails
public 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.LoginModuletrue if the authentication succeeded, or
  false if this LoginModule should be
  ignored
javax.security.auth.login.LoginException - if the commit fails
public SecurityConstraint[] findSecurityConstraints(Request request,
                                                    Context context)
null if there is no such constraint.
findSecurityConstraints in interface RealmfindSecurityConstraints in class RealmBaserequest - Request we are processingcontext - Context the Request is mapped to
public 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.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 javax.security.auth.login.LoginException
Subject.
login in interface javax.security.auth.spi.LoginModuletrue if the authentication succeeded, or
  false if this LoginModule should be
  ignored
javax.security.auth.login.LoginException - if the authentication fails
public boolean logout()
               throws javax.security.auth.login.LoginException
logout in interface javax.security.auth.spi.LoginModuletrue in all cases because thie
  LoginModule should not be ignored
javax.security.auth.login.LoginException - if logging out failedprotected void load()
| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||