Name
Package javax.security.auth.callback
Synopsis
This
package
defines a mechanism that allows the low-level code of a
javax.security.auth.spi.LoginModule
to interact
with the end-user of an application to obtain a username, password,
or other authentication-related information. The
LoginModule
sends messages and requests for
information in the form of objects that implement the
Callback
interface. An application that wants to
authenticate a user provides (via a
javax.security.auth.login.LoginContext
) a
CallbackHandler
object to convert these
Callback
objects into text or GUI-based
interactions with the user. An application that want to provide a
customized login interface must implement its own
CallbackHandler
. The
CallbackHandler
API consists of only a single
method, but the implementation of that method can require a
substantial amount of code. See the various
Callback
classes for directions on how a
CallbackHandler
should handle them.
Sun’s J2SE SDK for Java 1.4 ships with two
implementations of CallbackHandler
, both in the
package com.sun.security.auth.callback
. Although
these classes are not guaranteed to exist in all distributions,
text-based applications may use the
TextCallbackHandler
, and GUI-based applications
may use the DialogCallbackHandler
. Programmers
wanting to write a custom CallbackHandler
may also
find it useful to study the source code of these two existing
handlers.
Interfaces
public interface Callback; public interface CallbackHandler;
Classes
public class ChoiceCallback ...
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.