This is the callback method called when authentication data is
required. It either pops up a dialog box to request authentication
data or use text input.
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof NameCallback){
NameCallback nme = (NameCallback)callbacks[i];
nme.setName(username);
} else if (callbacks[i] instanceof PasswordCallback){
PasswordCallback pswd = (PasswordCallback)callbacks[i];
pswd.setPassword(password.toCharArray());
}
}