Class WSCredTokenCallbackImpl
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionWSCredTokenCallbackImpl
(String prompt) Construct aWSCredTokenCallbackImpl
object with a prompt hint.WSCredTokenCallbackImpl
(String prompt, byte[] defaultCredToken) Construct aWSCredTokenCallbackImpl
object with a prompt hint and a default credential token. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Return the credential token.byte[]
Return the default credential token.Return the prompt.void
setCredToken
(byte[] credToken) Set the credential token.toString()
Returns the name of the Callback.
-
Constructor Details
-
WSCredTokenCallbackImpl
Construct a
WSCredTokenCallbackImpl
object with a prompt hint.- Parameters:
prompt
- The prompt hint.
-
WSCredTokenCallbackImpl
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()
isnull
, thenull
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
, thennull
is returned.- Returns:
- The default credential token, could be
null
.
-
getPrompt
Return the prompt. If the prompt set in Constructor is
null
, thennull
is returned.- Returns:
- The prompt, could be
null
.
-
toString
Returns the name of the Callback. Typically, it is the name of the class.
-