com.ibm.wsspi.wssecurity.auth.callback

Class BinaryTokenCallback

  • java.lang.Object
    • com.ibm.wsspi.wssecurity.auth.callback.BinaryTokenCallback
  • All Implemented Interfaces:
    javax.security.auth.callback.Callback


    public class BinaryTokenCallback
    extends java.lang.Object
    implements javax.security.auth.callback.Callback

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

    However, since the credential token is typically in byte format and difficult to input interactively, it is usually passed to the LoginModule programmatically.

    Version:
    1.0
    See Also:
    CallbackHandler
    • Constructor Summary

      Constructors 
      Constructor and Description
      BinaryTokenCallback(java.lang.String prompt)
      Construct a BinaryTokenCallback object with a prompt hint.
      BinaryTokenCallback(java.lang.String prompt, byte[] defaultCredToken)
      Construct a BinaryTokenCallback object with a prompt hint and a default credential token.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      byte[] getCredToken()
      Return the credential token.
      byte[] getDefaultCredToken()
      Return the default credential token.
      java.lang.String getPrompt()
      Return the prompt.
      void setCredToken(byte[] credToken)
      Set the credential token.
      java.lang.String toString()
      Returns the name of the Callback.
      • Methods inherited from class java.lang.Object

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

      • BinaryTokenCallback

        public BinaryTokenCallback(java.lang.String prompt)

        Construct a BinaryTokenCallback object with a prompt hint.

        Parameters:
        prompt - The prompt hint.
      • BinaryTokenCallback

        public BinaryTokenCallback(java.lang.String prompt,
                           byte[] defaultCredToken)

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

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

      • 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 BinaryTokenCallback.setCredToken() is null, the null is returned.

        Returns:
        The credential token. Can be null.
      • getDefaultCredToken

        public byte[] getDefaultCredToken()

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

        Returns:
        The default credential token. Can be null.
      • getPrompt

        public java.lang.String getPrompt()

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

        Returns:
        The prompt. Can be null.
      • toString

        public java.lang.String toString()

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

        Overrides:
        toString in class java.lang.Object
        Returns:
        The name of the Callback.
IBM WebSphere Application ServerTM
Release 8.5