com.cafesoft.cams.auth.callback
Class NamePasswordCallbackHandler

java.lang.Object
  extended by com.cafesoft.cams.auth.callback.NamePasswordCallbackHandler
All Implemented Interfaces:
CallbackHandler
Direct Known Subclasses:
AutoLoginNamePasswordCallbackHandler

public class NamePasswordCallbackHandler
extends Object
implements CallbackHandler

CallbackHandler interface for JAAS LoginModules that must prompt for input. Provides the specified username and password when prompted by the Callback.

Since:
11/8/01

Constructor Summary
NamePasswordCallbackHandler()
          Create a new NamePasswordCallbackHandler (required Cams default constructor that is dynamically called by the authentication server).
NamePasswordCallbackHandler(String username, String password)
          Create a new NamePasswordCallbackHandler (optional constructor used to facilitate testing).
 
Method Summary
 void handle(Callback[] callbacks)
          Retrieve or display the information requested in the provided Callbacks.
 void setCams_cookie_domain(String cookieDomain)
          Set the Cams cookie domain.
 void setPassword(String password)
          Set the password.
 void setSession_id(String sessionId)
          Set the Cams session identifier.
 void setUsername(String username)
          Set the username.
 void setX509_client_cert(String x509CertPEM)
          Set an X509Certificate chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamePasswordCallbackHandler

public NamePasswordCallbackHandler()
Create a new NamePasswordCallbackHandler (required Cams default constructor that is dynamically called by the authentication server).


NamePasswordCallbackHandler

public NamePasswordCallbackHandler(String username,
                                   String password)
Create a new NamePasswordCallbackHandler (optional constructor used to facilitate testing).

Parameters:
username - the username to provide when prompted.
password - the password to provide when prompted.
Method Detail

setUsername

public void setUsername(String username)
Set the username.

Parameters:
username - the username to be provided to a NameCallback.

setPassword

public void setPassword(String password)
Set the password.

Parameters:
password - the password to be provided to a PasswordCallback.

setCams_cookie_domain

public void setCams_cookie_domain(String cookieDomain)
Set the Cams cookie domain. NOTE: this method was added to silence a "No such method" warning reported in the security domain trace log when this common callback value is added to HTTP authentication requests to facilitate efficient cross DNS domain SSO.

Parameters:
cookieDomain - the Cams cookie domain.

setX509_client_cert

public void setX509_client_cert(String x509CertPEM)
Set an X509Certificate chain. NOTE: the certificate may include one or more PEM-formatted X509 certificates including: "-----BEGIN CERTIFICATE-----"\n "-----END CERTIFICATE-----"

Parameters:
x509CertPEM - the PEM-encoded client certificate

setSession_id

public void setSession_id(String sessionId)
Set the Cams session identifier.

Parameters:
sessionId - an existing Cams session identifier in String form.

handle

public void handle(Callback[] callbacks)
            throws IOException,
                   UnsupportedCallbackException
Retrieve or display the information requested in the provided Callbacks. The handle method implementation checks the instance(s) of the Callback object(s) passed in to retrieve or display the requested information.

Specified by:
handle in interface CallbackHandler
Parameters:
callbacks - an array of Callback objects provided by an underlying security service which contains the information requested to be retrieved or displayed.
Throws:
IOException - if an input or output error ocurrs
UnsupportedCallbackException - if the implementation of this method does not support one or more of the Callbacks specified in the callbacks parameter


Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.