Class WSCredTokenCallbackImpl

java.lang.Object
com.ibm.websphere.security.auth.callback.WSCredTokenCallbackImpl
All Implemented Interfaces:
Callback

public class WSCredTokenCallbackImpl extends Object implements Callback

The WSCredTokenCallbackImpl allows credential token to be gathered by CallbackHandler and pass it to the LoginModule.

However, credential token usually is in byte format, it is very error prone and difficult to type it in. It usually pass to the LoginModule programmatically.

Since:
1.0
  • Constructor Details

    • WSCredTokenCallbackImpl

      public WSCredTokenCallbackImpl(String prompt)

      Construct a WSCredTokenCallbackImpl object with a prompt hint.

      Parameters:
      prompt - The prompt hint.
    • WSCredTokenCallbackImpl

      public WSCredTokenCallbackImpl(String prompt, byte[] defaultCredToken)

      Construct a WSCredTokenCallbackImpl object with a prompt hint and a default credential token.

      Parameters:
      prompt - The prompt hint.
      defaultCredToken - The default credential token.
  • Method Details

    • setCredToken

      public void setCredToken(byte[] credToken)

      Set the credential token.

      Parameters:
      credToken - The credential token.
    • getCredToken

      public byte[] getCredToken()

      Return the credential token. If the credential token set in WSCredTokenCallbackImpl.setCredToken() is null, the null is returned.

      Returns:
      The credential token, could be null.
    • getDefaultCredToken

      public byte[] getDefaultCredToken()

      Return the default credential token. If the credential token set in Constructor is null, then null is returned.

      Returns:
      The default credential token, could be null.
    • getPrompt

      public String getPrompt()

      Return the prompt. If the prompt set in Constructor is null, then null is returned.

      Returns:
      The prompt, could be null.
    • toString

      public String toString()

      Returns the name of the Callback. Typically, it is the name of the class.

      Overrides:
      toString in class Object
      Returns:
      The name of the Callback.