public class NameStoringHandler extends java.lang.Object implements AFCallbackHandler
NameCallback. This allows for correct name-based delay.
Otherwise an attack would be possible by not providing the name directly but
only via the callback handler.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
name
The name provided to a
NameCallback. |
protected AFCallbackHandler |
wrapped
The callback handler for all callbacks.
|
| Constructor and Description |
|---|
NameStoringHandler(AFCallbackHandler wrapped)
Creates a callback handler storing the name provided to a
NameCallback
by the wrapped AFCallbackHandler. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Gets the name that has been provided to a
NameCallback or
null in case there has not been a NameCallback. |
javax.security.auth.callback.Callback[] |
handle(javax.security.auth.callback.Callback[] callbacks)
This method is similar to
CallbackHandler.handle(Callback[]) but returns the provided callbacks back
to the caller. |
protected java.lang.String name
NameCallback.protected final AFCallbackHandler wrapped
public NameStoringHandler(AFCallbackHandler wrapped)
NameCallback
by the wrapped AFCallbackHandler.wrapped - The AFCallbackHandler to which all
callbacks will be forwarded. This must not be null.public javax.security.auth.callback.Callback[] handle(javax.security.auth.callback.Callback[] callbacks)
throws javax.security.auth.callback.UnsupportedCallbackException,
java.io.IOException
AFCallbackHandlerCallbackHandler.handle(Callback[]) but returns the provided callbacks back
to the caller. This allows for calling this method remotely. Note that all
callbacks need to be serialisable. handle in interface AFCallbackHandlercallbacks - The callbacks to be handled by this callback handler.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, an
UnsupportedCallbackException will be thrown.java.io.IOException - If an input or output error occurs, an
IOException will be thrown.public java.lang.String getName()
NameCallback or
null in case there has not been a NameCallback.NameCallback or
null in case there has not been a
NameCallback.