sharedState, options);
try {
if (jaasLoginModule.login()) {
jaasLoginModule.commit();
} else {
throw new AuthenticationException("login failed");
}
} catch (FailedLoginException e) {
throw new AuthenticationException(e);
} catch (LoginException e) {
log.error("login error", e);
throw new AuthenticationException(e);
}
Set principals = subject.getPrincipals(jaasUserPrincipalClass);
Iterator principalIterator = principals.iterator();
if (principalIterator.hasNext()) {
Principal jaasUserPrincipal = (Principal)principalIterator.next();