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.
This class recognizes the following string-valued options, which are specified in the configuration file and passed
to initialize(Subject, CallbackHandler, Map, Map) in the options argument:
MemoryRealm.
The default value matches the MemoryRealm default.MessageDigestCredentialHandler will be used.CredentialHandler. For example,
algorithm=SHA256 would result in a call to MessageDigestCredentialHandler#setAlgorithm(String)
with a parameter of "SHA256"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.
| Modifier and Type | Field and Description |
|---|---|
| protected CallbackHandler | callbackHandler
The callback handler responsible for answering our requests. |
| protected boolean | committed
Has our own |
| private static final Log | |
| protected Map | options
The configuration information for this |
| protected String | pathname
The absolute or relative pathname to the XML configuration file.
|
| protected Principal | principal
The |
| protected Map | sharedState
The state information that is shared with other configured |
| protected Subject | subject
The subject for which we are performing authentication. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | abort()
Implements javax. Method to abort the authentication process (phase 2). |
| public boolean | commit()
Implements javax. Method to commit the authentication process (phase 2). |
| private String | |
| public void | initialize(Subject
the subject, CallbackHandler Subject to be authenticated.a callbackHandler, Map<String, ?> CallbackHandler for communicating
with the end user (prompting for usernames and
passwords, for example).state shared with other configured LoginModules. sharedState, Map<String, ?> options specified in the login
options)Configuration for this particular
LoginModule.Implements javax. Initialize this |
| protected void | |
| public boolean | login()
Implements javax. Method to authenticate a |
| public boolean |
| callbackHandler | back to summary |
|---|---|
| protected CallbackHandler callbackHandler The callback handler responsible for answering our requests. | |
| committed | back to summary |
|---|---|
| protected boolean committed Has our own | |
| log | back to summary |
|---|---|
| private static final Log log | |
| options | back to summary |
|---|---|
| protected Map<String, ?> options The configuration information for this | |
| pathname | back to summary |
|---|---|
| protected String pathname Hides org. The absolute or relative pathname to the XML configuration file. | |
| principal | back to summary |
|---|---|
| protected Principal principal The | |
| sharedState | back to summary |
|---|---|
| protected Map<String, ?> sharedState The state information that is shared with other configured | |
| subject | back to summary |
|---|---|
| protected Subject subject The subject for which we are performing authentication. | |
| JAASMemoryLoginModule | back to summary |
|---|---|
| public JAASMemoryLoginModule() | |
| abort | back to summary |
|---|---|
| public boolean abort() throws LoginException Implements javax. Doc from javax. Method to abort the authentication process (phase 2). This method is called if the LoginContext's overall authentication failed. (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules did not succeed). If this LoginModule's own authentication attempt
succeeded (checked by retrieving the private state saved by the
| |
| commit | back to summary |
|---|---|
| public boolean commit() throws LoginException Implements javax. Doc from javax. Method to commit the authentication process (phase 2). This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded). If this LoginModule's own authentication attempt
succeeded (checked by retrieving the private state saved by the
| |
| getCatalinaBase | back to summary |
|---|---|
| private String getCatalinaBase() | |
| initialize | back to summary |
|---|---|
| public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) Implements javax. Doc from javax. Initialize this This method is called by the
| |
| load | back to summary |
|---|---|
| protected void load() Load the contents of our configuration file. | |
| login | back to summary |
|---|---|
| public boolean login() throws LoginException Implements javax. Doc from javax. Method to authenticate a The implementation of this method authenticates
a
| |
| logout | back to summary |
|---|---|
| public boolean logout() throws LoginException Implements javax. Doc from javax. Method which logs out a An implementation of this method might remove/destroy a Subject's Principals and Credentials.
| |