An implementation of CallbackHandler is assigned a Principal, and
opaque Object credential as values passed to the constructor. This is suitable
for environments that need non-interactive JAAS logins and is used by the
JaasSecurityManager as its default CallbackHandler.
- See also:
Initialize the UsernamePasswordHandler with the principal
and credentials to use.
Handles SecurityAssociationCallback, ObjectCallback, NameCallback and
PasswordCallback types. A NameCallback name property is set to
the Prinicpal.getName() value. A PasswordCallback password property is
set to the getPassword() value. The preferred SecurityAssociationCallback
has its principal and credential properties set to the instance principal
and credential. An ObjectCallback has its credential set to the credential
- UnsupportedCallbackException - thrown if any callback of
type other than SecurityAssociationCallback, ObjectCallback, NameCallback
or PasswordCallback are seen.
- See also:
for (int i = 0; i < callbacks.length; i++)
Try to convert the credential value into a char using the
first of the following attempts which succeeds:
1. Check for instanceof char
2. Check for instanceof String and then use toCharArray()
3. See if credential has a toCharArray() method and use it
4. Use toString() followed by toCharArray().
- a char representation of the credential.