use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class FileAuthenticationHandlerTests method verifyFailsUserNotInFileWithCommaSeparator.
@Test
public void verifyFailsUserNotInFileWithCommaSeparator() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
this.authenticationHandler = new FileAuthenticationHandler("", null, null, new ClassPathResource("authentication2.txt"), ",");
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 verifyExpiringAccount.
@Test
public void verifyExpiringAccount() throws Exception {
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casexpiring", "Mellon");
final AuthenticationHandlerExecutionResult result = handler.authenticate(c);
assertFalse(result.getWarnings().isEmpty());
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourceAuthenticationHandlerTests method verifyNotFoundAccount.
@Test
public void verifyNotFoundAccount() throws Exception {
this.thrown.expect(AccountNotFoundException.class);
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("nobody", "Mellon");
handler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourceAuthenticationHandlerTests method verifyMustChangePswAccount.
@Test
public void verifyMustChangePswAccount() throws Exception {
this.thrown.expect(AccountPasswordMustChangeException.class);
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casmustchange", "Mellon");
handler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourceAuthenticationHandlerTests method verifyOkAccount.
@Test
public void verifyOkAccount() throws Exception {
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser", "Mellon");
assertNotNull(handler.authenticate(c));
}
Aggregations