public class AutoCallbackHandler
extends java.lang.Object
implements javax.security.auth.callback.CallbackHandler
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.
Constructor and Description |
---|
AutoCallbackHandler(java.lang.String username,
java.lang.String password)
Creates a new
AutoCallbackHandler instance. |
Modifier and Type | Method and Description |
---|---|
void |
handle(javax.security.auth.callback.Callback[] callbacks)
The
handle method processes the given callbacks. |
public AutoCallbackHandler(java.lang.String username, java.lang.String password)
AutoCallbackHandler
instance.username
- the username, which may be null
password
- the password, which may be null
public void handle(javax.security.auth.callback.Callback[] callbacks) throws javax.security.auth.callback.UnsupportedCallbackException
handle
method processes the given callbacks. The
constructor argument username
is used to set the
name
property of any given NameCallback
and the
constructor argument password
is used to set the
password
property of any given PasswordCallback
.handle
in interface javax.security.auth.callback.CallbackHandler
callbacks
- a Callback
[]
valuejavax.security.auth.callback.UnsupportedCallbackException
- if a given Callback
is unsupportedCopyright © 2000-2020 TIBCO Software Inc. All Rights Reserved.