com.ibm.commerce.foundation.client.samples.security.auth.callback

Class SampleCallbackHandlerImpl

  • java.lang.Object
    • com.ibm.commerce.foundation.client.samples.security.auth.callback.SampleCallbackHandlerImpl
  • All Implemented Interfaces:
    javax.security.auth.callback.CallbackHandler


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

    A sample callback handler that is given the user name and password to be used for authentication. The purpose of this callback handler is to be used for unit testing purposes for authenticated Webservice request. The instance of the callback handler is given the credential information and this information is found in the SOAP header for authorization purposes.

    The purpose of this class is for testing purposes only.

    • Constructor Summary

      Constructors 
      Constructor and Description
      SampleCallbackHandlerImpl(java.lang.String userName, java.lang.String password)
      Creates an instance of the sample callback handler to flow authentication information for client service requests.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void handle(javax.security.auth.callback.Callback[] callbacks)
      This method populates the callback objects specified.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SampleCallbackHandlerImpl

        public SampleCallbackHandlerImpl(java.lang.String userName,
                                         java.lang.String password)
        Creates an instance of the sample callback handler to flow authentication information for client service requests.
        Parameters:
        userName - The user name associated with the callback.
        password - The password associated with the callback.
    • Method Detail

      • handle

        public void handle(javax.security.auth.callback.Callback[] callbacks)
                    throws java.io.IOException,
                           javax.security.auth.callback.UnsupportedCallbackException
        This method populates the callback objects specified. This implementation only understands the Name and Password call backs objects and will populate them with the user and password specified.
        Specified by:
        handle in interface javax.security.auth.callback.CallbackHandler
        Parameters:
        callbacks - The callback objects.
        Throws:
        java.io.IOException - This will never be thrown.
        javax.security.auth.callback.UnsupportedCallbackException - This will never be thrown.
        See Also:
        CallbackHandler.handle(javax.security.auth.callback.Callback[])