if (authenticator == null)
throw new LoginException("No Authenticator component found, check your configuration");
Credential[] credentials =
new Credential[]{new UsernameCredential(username), new PasswordCredential(password)};
String userId = authenticator.validateUser(credentials);
Identity identity = authenticator.createIdentity(userId);
sharedState.put("exo.security.identity", identity);
sharedState.put("javax.security.auth.login.name", userId);
// TODO use PasswordCredential wrapper
subject.getPrivateCredentials().add(password);
subject.getPublicCredentials().add(new UsernameCredential(username));
return true;
}
catch (final Throwable e)
{
LoginException le = new LoginException(e.getMessage());