use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class FileAuthenticationHandlerTests method verifyAuthenticateNoFileName.
@Test
public void verifyAuthenticateNoFileName() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
this.authenticationHandler = new FileAuthenticationHandler("", null, null, new ClassPathResource("fff"), FileAuthenticationHandler.DEFAULT_SEPARATOR);
c.setUsername("scott");
c.setPassword("rutgers");
this.thrown.expect(PreventedException.class);
this.authenticationHandler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class FileAuthenticationHandlerTests method verifyFailsUserNotInFileWithDefaultSeparator.
@Test
public void verifyFailsUserNotInFileWithDefaultSeparator() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
c.setUsername("fds");
c.setPassword("rutgers");
this.thrown.expect(AccountNotFoundException.class);
this.authenticationHandler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourceAuthenticationHandlerTests method verifyLockedAccount.
@Test
public void verifyLockedAccount() throws Exception {
this.thrown.expect(AccountLockedException.class);
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("caslocked", "Mellon");
handler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourceAuthenticationHandlerTests method verifyExpiredAccount.
@Test
public void verifyExpiredAccount() throws Exception {
this.thrown.expect(AccountExpiredException.class);
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casexpired", "Mellon");
handler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourceAuthenticationHandlerTests method verifyDisabledAccount.
@Test
public void verifyDisabledAccount() throws Exception {
this.thrown.expect(AccountDisabledException.class);
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casdisabled", "Mellon");
handler.authenticate(c);
}
Aggregations