Package org.apache.catalina.realm
Class JAASCallbackHandler
java.lang.Object
org.apache.catalina.realm.JAASCallbackHandler
- All Implemented Interfaces:
- 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.
 
- Author:
- Craig R. McClanahan, Andrew R. Jaquith
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final StringThe authentication method to be used.protected final StringClient generated nonce.protected final StringSecond digest.protected final StringNonce count.protected final StringServer generated nonce.protected final StringThe password to be authenticated with.protected final StringQuality of protection applied to the message.protected final JAASRealmThe associatedJAASRealminstance.protected final StringRealm name.protected static final StringManagerThe string manager for this package.protected final StringThe username to be authenticated with.
- 
Constructor SummaryConstructorsConstructorDescriptionJAASCallbackHandler(JAASRealm realm, String username, String password) Construct a callback handler configured with the specified values.JAASCallbackHandler(JAASRealm realm, String username, String password, String nonce, String nc, String cnonce, String qop, String realmName, String digestA2, String algorithm, String authMethod) Construct a callback handler for DIGEST authentication.
- 
Method Summary
- 
Field Details- 
smThe string manager for this package.
- 
passwordThe password to be authenticated with.
- 
realmThe associatedJAASRealminstance.
- 
usernameThe username to be authenticated with.
- 
nonceServer generated nonce.
- 
ncNonce count.
- 
cnonceClient generated nonce.
- 
qopQuality of protection applied to the message.
- 
realmNameRealm name.
- 
digestA2Second digest.
- 
authMethodThe authentication method to be used. If null, assume BASIC/FORM.
 
- 
- 
Constructor Details- 
JAASCallbackHandlerConstruct a callback handler configured with the specified values. Note that if theJAASRealminstance specifies digested passwords, thepasswordparameter will be pre-digested here.- Parameters:
- realm- Our associated JAASRealm instance
- username- Username to be authenticated with
- password- Password to be authenticated with
 
- 
JAASCallbackHandlerpublic JAASCallbackHandler(JAASRealm realm, String username, String password, String nonce, String nc, String cnonce, String qop, String realmName, String digestA2, String algorithm, String authMethod) Construct a callback handler for DIGEST authentication.- Parameters:
- realm- Our associated JAASRealm instance
- username- Username to be authenticated with
- password- Password to be authenticated with
- nonce- Server generated nonce
- nc- Nonce count
- cnonce- Client generated nonce
- qop- Quality of protection applied to the message
- realmName- Realm name
- digestA2- Second digest calculated as digest(Method + ":" + uri)
- algorithm- The digest algorithm to use
- authMethod- The authentication method in use
 
 
- 
- 
Method Details- 
handleRetrieve the information requested in the providedCallbacks. This implementation only recognizesNameCallback,PasswordCallbackandTextInputCallback.TextInputCallbackis used to pass the various additional parameters required for DIGEST authentication.- Specified by:
- handlein interface- CallbackHandler
- Parameters:
- callbacks- The set of- Callbacks to be processed
- Throws:
- IOException- if an input/output error occurs
- UnsupportedCallbackException- if the login method requests an unsupported callback type
 
 
-