|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSK.gnome.dwarf.auth.login.BasicCallbackHandler
Provides the basic username/password callback handler.
It can be used to provide username and password which are already known in the moment of creating the handler.
This handler accepts an username without a password to support the identification
feature of the GenericLoginModule
class. In that case, the password returned by
the PasswordCallback will be null.
Sample usage:
// instantiate the subject Subject subject = new Subject(); // authenticate the user "joe" with the "public" password AuthId id = login("MyConfiguration", subject, new BasicCallbackHandler("joe", "public"));
GenericLoginModule
Constructor Summary | |
BasicCallbackHandler(java.lang.String username)
Creates a new BasicCallbackHandler with the given user name. |
|
BasicCallbackHandler(java.lang.String username,
char[] password)
Creates a new BasicCallbackHandler with the given user name and password. |
Method Summary | |
void |
handle(javax.security.auth.callback.Callback[] callbacks)
Handles the given callbacks. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicCallbackHandler(java.lang.String username)
Use this contructor only to enable the identification feature of the
GenericLoginModule
class.
username
- the user name
java.lang.NullPointerException
- if the username is nullpublic BasicCallbackHandler(java.lang.String username, char[] password)
username
- the user namepassword
- the password
java.lang.NullPointerException
- if the username or password is nullMethod Detail |
public void handle(javax.security.auth.callback.Callback[] callbacks) throws java.io.IOException, javax.security.auth.callback.UnsupportedCallbackException
The supported callbacks are NameCallback for the username and PasswordCallback for the user password.
handle
in interface javax.security.auth.callback.CallbackHandler
callbacks
- the array of callbacks
java.io.IOException
- in the case of IO error
javax.security.auth.callback.UnsupportedCallbackException
- if a callback is not supported
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |