Package com.spotfire.server.jaas.util
Class AutoCallbackHandler
java.lang.Object
com.spotfire.server.jaas.util.AutoCallbackHandler
- All Implemented Interfaces:
CallbackHandler
The
AutoCallbackHandler
is a utility class that can be
used by all JAAS clients. It automatically handles
Callback
processing without requiring any user
interaction, which makes it suitable for web application
environments, where the user interaction has special
requirements.
The constructor takes one username
and one
password
argument. The username
is used to
set the name
property of a NameCallback
and
the password
is used to set the password
property of a PasswordCallback
. Both constructor
arguments may be null
.
The supported Callback
implementations are
NameCallback
and PasswordCallback
. The
handle
throws an
UnsupportedCallbackException
for all other
Callback
classes.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionAutoCallbackHandler
(String username, String password) Creates a newAutoCallbackHandler
instance. -
Method Summary
-
Constructor Details
-
AutoCallbackHandler
Creates a newAutoCallbackHandler
instance.- Parameters:
username
- the username, which may benull
password
- the password, which may benull
- Since:
- 3.0
-
-
Method Details
-
handle
Thehandle
method processes the given callbacks. The constructor argumentusername
is used to set thename
property of any givenNameCallback
and the constructor argumentpassword
is used to set thepassword
property of any givenPasswordCallback
.- Specified by:
handle
in interfaceCallbackHandler
- Parameters:
callbacks
- aCallback
[]
value- Throws:
UnsupportedCallbackException
- if a givenCallback
is unsupported- Since:
- 3.0
-