public class JAASCallbackHandler
extends java.lang.Object
implements javax.security.auth.callback.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).
This CallbackHandler
will pre-digest the supplied
password, if required by the <Realm>
element in
server.xml
.
At present, JAASCallbackHandler
knows how to handle callbacks of
type javax.security.auth.callback.NameCallback
and
javax.security.auth.callback.PasswordCallback
.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
authMethod
The authentication method to be used.
|
protected java.lang.String |
cnonce
Client generated nonce.
|
protected java.lang.String |
md5a2
Second MD5 digest.
|
protected java.lang.String |
nc
Nonce count.
|
protected java.lang.String |
nonce
Server generated nonce.
|
protected java.lang.String |
password
The password to be authenticated with.
|
protected java.lang.String |
qop
Quality of protection applied to the message.
|
protected JAASRealm |
realm
The associated
JAASRealm instance. |
protected java.lang.String |
realmName
Realm name.
|
protected static StringManager |
sm
The string manager for this package.
|
protected java.lang.String |
username
The username to be authenticated with.
|
Constructor and Description |
---|
JAASCallbackHandler(JAASRealm realm,
java.lang.String username,
java.lang.String password)
Construct a callback handler configured with the specified values.
|
JAASCallbackHandler(JAASRealm realm,
java.lang.String username,
java.lang.String password,
java.lang.String nonce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String qop,
java.lang.String realmName,
java.lang.String md5a2,
java.lang.String authMethod)
Construct a callback handler for DIGEST authentication.
|
Modifier and Type | Method and Description |
---|---|
void |
handle(javax.security.auth.callback.Callback[] callbacks)
Retrieve the information requested in the provided
Callbacks . |
protected static final StringManager sm
protected final java.lang.String password
protected final JAASRealm realm
JAASRealm
instance.protected final java.lang.String username
protected final java.lang.String nonce
protected final java.lang.String nc
protected final java.lang.String cnonce
protected final java.lang.String qop
protected final java.lang.String realmName
protected final java.lang.String md5a2
protected final java.lang.String authMethod
public JAASCallbackHandler(JAASRealm realm, java.lang.String username, java.lang.String password)
JAASRealm
instance specifies digested passwords,
the password
parameter will be pre-digested here.realm
- Our associated JAASRealm instanceusername
- Username to be authenticated withpassword
- Password to be authenticated withpublic JAASCallbackHandler(JAASRealm realm, java.lang.String username, java.lang.String password, java.lang.String nonce, java.lang.String nc, java.lang.String cnonce, java.lang.String qop, java.lang.String realmName, java.lang.String md5a2, java.lang.String authMethod)
realm
- Our associated JAASRealm instanceusername
- Username to be authenticated withpassword
- Password to be authenticated withnonce
- Server generated noncenc
- Nonce countcnonce
- Client generated nonceqop
- Quality of protection applied to the messagerealmName
- Realm namemd5a2
- Second MD5 digest used to calculate the digest
MD5(Method + ":" + uri)authMethod
- The authentication method in usepublic void handle(javax.security.auth.callback.Callback[] callbacks) throws java.io.IOException, javax.security.auth.callback.UnsupportedCallbackException
Callbacks
.
This implementation only recognizes NameCallback
,
PasswordCallback
and TextInputCallback
.
TextInputCallback
is used to pass the various additional
parameters required for DIGEST authentication.handle
in interface javax.security.auth.callback.CallbackHandler
callbacks
- The set of Callback
s to be processedjava.io.IOException
- if an input/output error occursjavax.security.auth.callback.UnsupportedCallbackException
- if the login method requests
an unsupported callback typeCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.