options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, server.getServerInfo());
Subject sub = new Subject();
CallbackHandler handler = new CallbackHandler() {
public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
Callback callback = callbacks[i];
if (callback instanceof PasswordCallback) {
((PasswordCallback) callback).setPassword(password.toCharArray());
} else if (callback instanceof NameCallback) {
((NameCallback) callback).setName(username);
} else {