net.sf.jguard.authentication
Class PassiveCallbackHandler

java.lang.Object
  extended bynet.sf.jguard.authentication.PassiveCallbackHandler
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

public class PassiveCallbackHandler
extends java.lang.Object
implements javax.security.auth.callback.CallbackHandler

this class comes from the article called "all that jaas" posted on javaword.com in 2002. http://www.javaworld.com/javaworld/jw-09-2002/jw-0913-jaas.html

PassiveCallbackHandler has constructor that takes a username and password so its handle() method does not have to prompt the user for input. Useful for server-side applications.

Author:
Paul Feuer and John Musser, Charles Gay

Constructor Summary
PassiveCallbackHandler(java.lang.String user, java.lang.String pass)
          Creates a callback handler with the give username and password.
 
Method Summary
 void clearPassword()
          Clears out password state.
 void handle(javax.security.auth.callback.Callback[] callbacks)
          Handles the specified set of Callbacks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassiveCallbackHandler

public PassiveCallbackHandler(java.lang.String user,
                              java.lang.String pass)

Creates a callback handler with the give username and password.

Parameters:
user -
pass -
Method Detail

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws java.io.IOException,
                   javax.security.auth.callback.UnsupportedCallbackException
Handles the specified set of Callbacks. Uses the username and password that were supplied to our constructor to popluate the Callbacks. This class supports NameCallback and PasswordCallback.

Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Parameters:
callbacks - the callbacks to handle
Throws:
java.io.IOException - if an input or output error occurs.
javax.security.auth.callback.UnsupportedCallbackException - if the callback is not an instance of NameCallback or PasswordCallback

clearPassword

public void clearPassword()
Clears out password state.