## org.apache.catalina.realm
Class JAASCallbackHandler

    java.lang.Object
      org.apache.catalina.realm.JAASCallbackHandler

All Implemented Interfaces:
  javax.security.auth.callback.CallbackHandler

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).

Version:
  $Revision: 1.2 $ $Date: 2004/08/26 21:37:21 $
Author:
  Craig R. McClanahan

Field Summary
`protected java.lang.String` `password` The password to be authenticated with.
`protected JAASRealm` `realm` The associated `JAASRealm` instance.
`protected java.lang.String` `username` The username to be authenticated with.

Constructor Summary
`JAASCallbackHandler(JAASRealm realm, java.lang.String username, java.lang.String password)` Construct a callback handler configured with the specified values.

Method Summary
`void` `handle(javax.security.auth.callback.Callback[] callbacks)` Retrieve the information requested in the provided Callbacks.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### password

    protected java.lang.String password

  The password to be authenticated with.

### realm

    protected JAASRealm realm

  The associated `JAASRealm` instance.

### username

    protected java.lang.String username

  The username to be authenticated with.

Constructor Detail

### JAASCallbackHandler

    public JAASCallbackHandler(JAASRealm realm,
                               java.lang.String username,
                               java.lang.String password)

  Construct a callback handler configured with the specified values.

Parameters:
  `realm` - Our associated JAASRealm instance
  `username` - Username to be authenticated with
  `password` - Password to be authenticated with

Method Detail

### handle

    public void handle(javax.security.auth.callback.Callback[] callbacks)
                throws java.io.IOException,
                       javax.security.auth.callback.UnsupportedCallbackException

  Retrieve the information requested in the provided Callbacks. This implementation only recognizes `NameCallback` and `PasswordCallback` instances.

  Specified by:
    `handle` in interface `javax.security.auth.callback.CallbackHandler`
  Parameters:
    `callbacks` - The set of callbacks to be processed
  Throws:
    `java.io.IOException` - if an input/output error occurs
    `javax.security.auth.callback.UnsupportedCallbackException` - if the login method requests an unsupported callback type

Copyright ? 2000-2002 Apache Software Foundation. All Rights Reserved.