VLJ Iteration II, v. 1.0.0.193

gov.va.med.foundations.security.vistalink
Class CallbackHandlerSwing

java.lang.Object
  |
  +--gov.va.med.foundations.security.vistalink.CallbackHandlerSwing
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

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

Implements the JAAS CallbackHandler interface. Use with the VistaLoginModule to invoke a Swing-based interactive logon. Input values (access code, verify code, division selection, and other "user input") is collected via a set of GUI dialogs when this callback handler is used.

  1. Create an instance of CallbackHandlerSwing. No parameters are needed.
  2. Create the JAAS LoginContext instance, passing the instance of the callback handler as one of the parameters.
  3. Invoke the JAAS login context's login method. The callback handler will invoke Swing dialogs to collect user input wherever required for login.
For example:
 String cfgName = "RpcSampleServer";
 
 // create the callback handler
 CallbackHandlerSwing cbhSwing = new CallbackHandlerSwing(myFrame);
 
 // create the LoginContext
 loginContext = new LoginContext(cfgName, cbhSwing);
 
 // login to server
 loginContext.login(); 
 
 

Version:
1.0.0.193
Author:
Application Modernization - Foundations Team
See Also:
VistaLoginModule

Constructor Summary
CallbackHandlerSwing(java.awt.Frame windowParent)
          Instantiates a JAAS callback handler for Swing applications.
 
Method Summary
 void handle(javax.security.auth.callback.Callback[] callbacks)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackHandlerSwing

public CallbackHandlerSwing(java.awt.Frame windowParent)
Instantiates a JAAS callback handler for Swing applications.

Parameters:
windowParent - Allows dialogs launched during login to know about the parent window that launched them. This may be useful in several areas, one of which is accessibility; screen readers can verbally link a dialog to the parent window that launched the dialog. While null could be passed in, it is recommended to pass in the parent frame.
Method Detail

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws javax.security.auth.callback.UnsupportedCallbackException
Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
javax.security.auth.callback.UnsupportedCallbackException
See Also:
javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback)

VLJ Iteration II, v. 1.0.0.193

VistaLink Iteration II, v. 1.0.0.193