initialize
void initialize(Subject subject, CallbackHandler CallbackHandler,
Map sharedState, Map options);
The initialize method
is called to initialize the LoginModule with the
relevant authentication and state information.
This method is
called by a LoginContext immediately after this LoginModule has
been instantiated, and prior to any calls to its other public methods.
The method implementation should store away the provided arguments
for future use.
The initialize method may additionally
peruse the provided sharedState to determine what additional
authentication state it was provided by other LoginModules,
and may also traverse through the provided options to determine
what configuration options were specified to affect the LoginModule's
behavior. It may save option values in variables for future use.
Note: JAAS LoginModules may use the options defined in PAM (use_first_pass,
try_first_pass, use_mapped_pass, and
try_mapped_pass) to achieve single-signon. See
Making
Login Services Independent from Authentication Technologies for further information.
The following list shows options commonly supported by LoginModules. Note that the following is simply a guideline. Modules are free to support a subset (or none) of the following options.
try_first_pass- Iftrue, the first LoginModule in the stack saves the password entered, and subsequent LoginModules also try to use it. If authentication fails, the LoginModules prompt for a new password and retry the authentication.use_first_pass- Iftrue, the first LoginModule in the stack saves the password entered, and subsequent LoginModules also try to use it. LoginModules do not prompt for a new password if authentication fails (authentication simply fails).try_mapped_pass- Iftrue, the first LoginModule in the stack saves the password entered, and subsequent LoginModules attempt to map it into their service-specific password. If authentication fails, the LoginModules prompt for a new password and retry the authentication.use_mapped_pass- Iftrue, the first LoginModule in the stack saves the password entered, and subsequent LoginModules attempt to map it into their service-specific password. LoginModules do not prompt for a new password if authentication fails (authentication simply fails).moduleBanner- Iftrue, then when invoking the CallbackHandler, the LoginModule provides a TextOutputCallback as the first Callback, which describes the LoginModule performing the authentication.debug- Iftrue, instructs a LoginModule to output debugging information.
The initialize method may freely ignore state
or options it does not understand, although it would be wise to log
such an event if it does occur.
Note that the LoginContext invoking
this LoginModule (and the other configured LoginModules,
as well), all share the same references to the provided Subject and sharedState.
Modifications to the Subject and sharedState will,
therefore, be seen by all.