Package javax.security.auth.callback
Interface CallbackHandler
-
public interface CallbackHandlerNeeds to be implemented by classes that want to handle authenticationCallbacks. A single methodhandle(Callback[])must be provided that checks the type of the incomingCallbacks and reacts accordingly.CallbackHandlers can be installed per application. It is also possible to configure a system-defaultCallbackHandlerby setting theauth.login.defaultCallbackHandlerproperty in the standardsecurity.propertiesfile.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandle(Callback[] callbacks)Handles the actualCallback.
-
-
-
Method Detail
-
handle
void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
Handles the actualCallback. ACallbackHandlerneeds to implement this method. In the method, it is free to select whichCallbacks it actually wants to handle and in which way. For example, a console-basedCallbackHandlermight choose to sequentially ask the user for login and password, if it implements theseCallbacks, whereas a GUI-based one might open a single dialog window for both values. If aCallbackHandleris not able to handle a specificCallback, it needs to throw anUnsupportedCallbackException.- Parameters:
callbacks- the array ofCallbacks that need handling- Throws:
IOException- if an I/O related error occursUnsupportedCallbackException- if theCallbackHandleris not able to handle a specificCallback
-
-