VistALink v1.5.0.026

gov.va.med.vistalink.security
Class CallbackHandlerUnitTest

java.lang.Object
  extended bygov.va.med.vistalink.security.CallbackHandlerBase
      extended bygov.va.med.vistalink.security.CallbackHandlerUnitTest
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

public final class CallbackHandlerUnitTest
extends gov.va.med.vistalink.security.CallbackHandlerBase

Implements the JAAS CallbackHandler interface. Use with the VistaLoginModule to invoke a silent signon. Intended for use in unit testing environments where logins must be called repetitively without user interaction. Not for use in production environments, where users should be interactively prompted for signon credentials.

  1. Pass access code, verify code and division as parameters when you create an instance of this callback handler.
  2. Pass the instance of the callback handler to the login context when you create the login context.
  3. Then, when VistaLoginModule'slogin method (via the indirection of the LoginContext) invokes this callback handler to collect user input for (access code, verify code, select division), these values are already present and are handed back to the login module without any user interation.
For example:

String cfgName = "RpcSampleServer";
String accessCode = "joe.123";
String verifyCode = "ebony.23";
String division = "";

// create the callbackhandler for JAAS login
CallbackHandlerUnitTest cbhSilentSimple =
new CallbackHandlerUnitTest(accessCode, verifyCode, division);

// create the JAAS LoginContext for login
lc = new LoginContext(cfgName, cbhSilentSimple);

// login to server
lc.login();

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

Constructor Summary
CallbackHandlerUnitTest(java.lang.String accessCode, java.lang.String verifyCode, java.lang.String divisionIen)
          Creates a simple callback handler that handles the callbacks for logon (w/av code) and post-sign-in text only.
CallbackHandlerUnitTest(java.lang.String accessCode, java.lang.String oldVerifyCode, java.lang.String divisionIen, java.lang.String newVerifyCode, java.lang.String newVerifyCodeCheck)
           
 
Method Summary
 void handle(javax.security.auth.callback.Callback[])
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackHandlerUnitTest

public CallbackHandlerUnitTest(java.lang.String accessCode,
                               java.lang.String verifyCode,
                               java.lang.String divisionIen)
Creates a simple callback handler that handles the callbacks for logon (w/av code) and post-sign-in text only. It does not handle callbacks for error, select division, or change verify code..

Parameters:
accessCode - Access Code to use for logon
verifyCode - Verify Code to use for logon
divisionIen - IEN of division to select for multidivisional logins. If not needed, pass an empty string.

CallbackHandlerUnitTest

public CallbackHandlerUnitTest(java.lang.String accessCode,
                               java.lang.String oldVerifyCode,
                               java.lang.String divisionIen,
                               java.lang.String newVerifyCode,
                               java.lang.String newVerifyCodeCheck)
Parameters:
accessCode - Access Code to use for logon
oldVerifyCode - Verify Code to use for logon
divisionIen - IEN of division to select for multidivisional logins. If not needed, pass an empty string.
newVerifyCode - new verify code to change
newVerifyCodeCheck - should be the same as newVerifyCode, to be successful. Used as a check.
Method Detail

handle

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

VistALink v1.5.0.026

VistALink v1.5.0.026