org.jboss.security.auth.callback
Class UsernamePasswordHandler

java.lang.Object
  extended by org.jboss.security.auth.callback.UsernamePasswordHandler
All Implemented Interfaces:
CallbackHandler

public class UsernamePasswordHandler
extends Object
implements CallbackHandler

A simple implementation of CallbackHandler that sets a username and password in the handle(Callback[]) method to that passed in to the constructor. This is suitable for environments that need non-interactive JAAS logins.

Version:
$Revision: 1.5 $
Author:
Scott.Stark@jboss.org
See Also:
CallbackHandler, handle(Callback[])

Constructor Summary
UsernamePasswordHandler(String username, char[] password)
          Initialize the UsernamePasswordHandler with the usernmae and password to use.
UsernamePasswordHandler(String username, Object credential)
           
 
Method Summary
 void handle(Callback[] callbacks)
          Sets any NameCallback name property to the instance username, sets any PasswordCallback password property to the instance, and any password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsernamePasswordHandler

public UsernamePasswordHandler(String username,
                               char[] password)
Initialize the UsernamePasswordHandler with the usernmae and password to use.


UsernamePasswordHandler

public UsernamePasswordHandler(String username,
                               Object credential)
Method Detail

handle

public void handle(Callback[] callbacks)
            throws UnsupportedCallbackException
Sets any NameCallback name property to the instance username, sets any PasswordCallback password property to the instance, and any password.

Specified by:
handle in interface CallbackHandler
Throws:
UnsupportedCallbackException, - thrown if any callback of type other than NameCallback or PasswordCallback are seen.
UnsupportedCallbackException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.