An application implements a
CallbackHandler and passes
it to underlying security services so that they may interact with
the application to retrieve specific authentication data,
such as usernames and passwords, or to display certain information,
such as error and warning messages.
CallbackHandlers are implemented in an application-dependent fashion. For example, implementations for an application with a graphical user interface (GUI) may pop up windows to prompt for requested information or to display error messages. An implementation may also choose to obtain requested information from an alternate source without asking the end user.
Underlying security services make requests for different types
of information by passing individual Callbacks to the
implementation decides how to retrieve and display information
depending on the Callbacks passed to it. For example,
if the underlying service needs a username and password to
authenticate a user, it uses a
can then choose to prompt for a username and password serially,
or to prompt for both in a single window.
CallbackHandler class implementation
may be specified by setting the value of the
auth.login.defaultCallbackHandler security property.
If the security property is set to the fully qualified name of a
CallbackHandler implementation class,
LoginContext will load the specified
CallbackHandler and pass it to the underlying LoginModules.
LoginContext only loads the default handler
if it was not provided one.
All default handler implementations must provide a public zero-argument constructor.