com.ibm.websphere.security.auth.callback

Class WSCallbackHandlerImpl

  • java.lang.Object
    • com.ibm.websphere.security.auth.callback.WSCallbackHandlerImpl
  • All Implemented Interfaces:
    javax.security.auth.callback.CallbackHandler


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

    The WSCallbackHandlerImpl allows authentication data to be pushed to the login module, i.e. without prompting for the data.

    Supported Callbacks:

    • javax.security.auth.callback.NameCallback
    • javax.security.auth.callback.PasswordCallback
    • com.ibm.websphere.security.auth.callback.WSCredTokenCallbackImpl
    • com.ibm.websphere.security.auth.callback.WSRealmNameCallbackImpl
    • com.ibm.wsspi.security.auth.callback.WSAppContextCallback

    Since:
    1.0
    Version:
    1.0
    See Also:
    NameCallback, PasswordCallback, WSRealmNameCallbackImpl, com.ibm.websphere.security.callback.WSCredTokenCallbackImpl, WSAppContextCallback
    • Constructor Summary

      Constructors 
      Constructor and Description
      WSCallbackHandlerImpl(byte[] credToken)
      Push Credential Token to login module.
      WSCallbackHandlerImpl(java.lang.String userName, java.lang.String password)
      Push the username and password to login module.
      WSCallbackHandlerImpl(java.lang.String userName, java.lang.String realmName, java.lang.String password)
      Push the username and password to login module.
      WSCallbackHandlerImpl(java.lang.String userName, java.lang.String realmName, java.lang.String password, java.util.Map appContext)
      Push the username and password to login module.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void handle(javax.security.auth.callback.Callback[] callbacks)
      This implementation of CallbackHandler pushes the data specified in the constructor to the login module.
      • Methods inherited from class java.lang.Object

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

      • WSCallbackHandlerImpl

        public WSCallbackHandlerImpl(java.lang.String userName,
                             java.lang.String password)

        Push the username and password to login module.

        Parameters:
        userName - The user name of the principal.
        password - The password in clear text.
      • WSCallbackHandlerImpl

        public WSCallbackHandlerImpl(java.lang.String userName,
                             java.lang.String realmName,
                             java.lang.String password)

        Push the username and password to login module. The realmName is only need if it's different from the current realm. If you intend to login to the current realm, you do not need to specify a realm or you can specify the current realm. If you specify a realm different from the current realm, then a BasicAuth Subject is created for use downsteam.

        Parameters:
        userName - The user name of the principal.
        realmName - The realm name, if different from the current realm
        password - The password in clear text.
      • WSCallbackHandlerImpl

        public WSCallbackHandlerImpl(java.lang.String userName,
                             java.lang.String realmName,
                             java.lang.String password,
                             java.util.Map appContext)

        Push the username and password to login module. The realmName is only need if it's different from the current realm. If you intend to login to the current realm, you do not need to specify a realm or you can specify the current realm. If you specify a realm different from the current realm, then a BasicAuth Subject is created for use downsteam.

        If the realm you specify is different from the current realm and you want to validate the userid/password at the new target realm during this login, then you must specify a java.util.Map which contains the following properites: javax.naming.Context.PROVIDER_URL Example: "corbaloc:iiop:myhost.mycompany.com:2809" javax.naming.Context.INITIAL_CONTEXT_FACTORY Example: "com.ibm.websphere.naming.WsnInitialContextFactory" Note: If the target server is not a WebSphere server, then do not specify this information since it will not validate successfully. Also, the target server must support CSIv2 in order for the userid/password to be successfully sent.

        Parameters:
        userName - The user name of the principal.
        realmName - The realm name, if different from the current realm
        password - The password in clear text.
        appContext - A java.util.Map containing naming properties to validate userid/password.
      • WSCallbackHandlerImpl

        public WSCallbackHandlerImpl(byte[] credToken)

        Push Credential Token to login module. The Credential Token should be treated as an opaque object. The credential token must be in the format recognized by WebSphere Secure Association Service.

        Parameters:
        credToken - The credential token.
    • Method Detail

      • handle

        public void handle(javax.security.auth.callback.Callback[] callbacks)
                    throws java.io.IOException,
                           javax.security.auth.callback.UnsupportedCallbackException

        This implementation of CallbackHandler pushes the data specified in the constructor to the login module.

        Specified by:
        handle in interface javax.security.auth.callback.CallbackHandler
        Parameters:
        callbacks - An array of Callback objects provided by the underlying security service which contains the information requested to be retrieved or displayed.
        Throws:
        java.io.IOException - If an input or output error occurs.
        javax.security.auth.callback.UnsupportedCallbackException - If the implementation of this method does not support one or more of the Callbacks specified in the callbacks parameter.
IBM WebSphere Application ServerTM
Release 8.5