com.ibm.websphere.security.auth.callback

Class WSCredTokenCallbackImpl

  1. java.lang.Object
  2. extended bycom.ibm.websphere.security.auth.callback.WSCredTokenCallbackImpl
All implemented interfaces:
javax.security.auth.callback.Callback

  1. public class WSCredTokenCallbackImpl
  2. extends java.lang.Object
  3. implements javax.security.auth.callback.Callback

The WSCredTokenCallbackImpl allows credential token to be gathered by CallbackHandler and pass it to the LoginModule. This is used by WSClientLoginModuleImpl and WSLoginModuleImpl.

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. WebSphere only support credential token that conforms to WebSphere SAS credential token format.

Since:
1.0
Version:
1.0
See Also:
CallbackHandler, WSCallbackHandlerImpl, com.ibm.websphere.security.auth.module.WSClientLoginModuleImpl, com.ibm.websphere.security.auth.module.WSLoginModuleImpl

Constructor Summary

Constructor and Description
WSCredTokenCallbackImpl(java.lang.String prompt)
Construct a WSCredTokenCallbackImpl object with a prompt hint.
WSCredTokenCallbackImpl(java.lang.String prompt,byte[] defaultCredToken)
Construct a WSCredTokenCallbackImpl object with a prompt hint and a default credential token.

Method Summary

Modifier and Type Method and Description
  1. byte[]
getCredToken()
Return the credential token.
  1. byte[]
getDefaultCredToken()
Return the default credential token.
  1. java.lang.String
getPrompt()
Return the prompt.
  1. void
setCredToken(byte[] credToken)
Set the credential token.
  1. 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

WSCredTokenCallbackImpl

  1. public WSCredTokenCallbackImpl( java.lang.String prompt)

Construct a WSCredTokenCallbackImpl object with a prompt hint.

Parameters:
prompt - The prompt hint.

WSCredTokenCallbackImpl

  1. public WSCredTokenCallbackImpl( java.lang.String prompt,
  2. 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 Detail

setCredToken

  1. public void setCredToken(byte[] credToken)

Set the credential token.

Parameters:
credToken - The credential token.

getCredToken

  1. 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

  1. 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

  1. public java.lang.String getPrompt( )

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

Returns:
The prompt, could be null.

toString

  1. 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.