public class JAASCallbackHandler extends Object implements CallbackHandler
Implementation of the JAAS CallbackHandler interface, used to negotiate delivery of the username and credentials that were specified to our constructor. No interaction with the user is required (or possible).
Modifier and Type | Field and Description |
---|---|
protected char[] |
password
The password to be authenticated with.
|
protected JAASRealm |
realm
The associated
JAASRealm instance. |
protected String |
username
The username to be authenticated with.
|
Constructor and Description |
---|
JAASCallbackHandler(JAASRealm realm,
String username,
char[] password)
Construct a callback handler configured with the specified values.
|
Modifier and Type | Method and Description |
---|---|
void |
handle(Callback[] callbacks)
Retrieve the information requested in the provided Callbacks.
|
protected char[] password
protected JAASRealm realm
JAASRealm
instance.protected String username
public JAASCallbackHandler(JAASRealm realm, String username, char[] password)
realm
- Our associated JAASRealm instanceusername
- Username to be authenticated withpassword
- Password to be authenticated withpublic void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
NameCallback
and
PasswordCallback
instances.handle
in interface CallbackHandler
callbacks
- The set of callbacks to be processedIOException
- if an input/output error occursUnsupportedCallbackException
- if the login method requests
an unsupported callback typeCopyright © 2019. All rights reserved.