NIHVIVO-2694 Make sure that the BasicAuthenticator and the AuthenticatorStub comply to the contract on throwing LoginNotPermitted exceptions.

This commit is contained in:
j2blake 2012-02-02 16:18:22 +00:00
parent 19f9e10ffb
commit 78c19dde80
3 changed files with 12 additions and 2 deletions

View file

@ -137,7 +137,11 @@ public class AuthenticatorStub extends Authenticator {
@Override
public void recordLoginAgainstUserAccount(UserAccount userAccount,
AuthenticationSource authSource) {
AuthenticationSource authSource) throws LoginNotPermitted {
if (!isUserPermittedToLogin(userAccount)) {
throw new LoginNotPermitted();
}
recordedLogins.add(userAccount.getEmailAddress());
LoginStatusBean lsb = new LoginStatusBean(userAccount.getUri(),