{
groupsArray = ((GroupPrincipalCallback)callback).getGroups();
}
else if (callback instanceof PasswordValidationCallback)
{
PasswordValidationCallback passwordValidationCallback = (PasswordValidationCallback) callback;
Subject subject = passwordValidationCallback.getSubject();
final String userName = passwordValidationCallback.getUsername();
final char[] password = passwordValidationCallback.getPassword();
try {
LoginContext loginContext = ContextManager.login(subject, realm, new CallbackHandler() {
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (Callback callback: callbacks) {
if (callback instanceof NameCallback) {
((NameCallback)callback).setName(userName);
} else if (callback instanceof PasswordCallback) {
((PasswordCallback)callback).setPassword(password);
} else throw new UnsupportedCallbackException(callback);
}
}
});
passwordValidationCallback.setResult(true);
} catch (LoginException e) {
passwordValidationCallback.setResult(false);
}
}
//server to jaspi communication
//TODO implement these