use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class FileAuthenticationHandlerTests method verifyFailsNullUserNameAndPassword.
@Test
public void verifyFailsNullUserNameAndPassword() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
c.setUsername(null);
c.setPassword(null);
this.thrown.expect(AccountNotFoundException.class);
this.authenticationHandler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class FileAuthenticationHandlerTests method verifyFailsGoodUsernameBadPassword.
@Test
public void verifyFailsGoodUsernameBadPassword() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
this.authenticationHandler = new FileAuthenticationHandler("", null, null, new ClassPathResource("authentication2.txt"), ",");
c.setUsername("scott");
c.setPassword("rutgers1");
this.thrown.expect(FailedLoginException.class);
this.authenticationHandler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class RejectUsersAuthenticationHandlerTests method verifyFailsUserInMap.
@Test
public void verifyFailsUserInMap() throws Exception {
final UsernamePasswordCredential c = new UsernamePasswordCredential();
c.setUsername("scott");
c.setPassword("rutgers");
this.thrown.expect(FailedLoginException.class);
this.authenticationHandler.authenticate(c);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class InspektrThrottledSubmissionByIpAddressAndUsernameHandlerInterceptorAdapterTests method badCredentials.
private static UsernamePasswordCredential badCredentials(final String username) {
final UsernamePasswordCredential credentials = new UsernamePasswordCredential();
credentials.setUsername(username);
credentials.setPassword("badpassword");
return credentials;
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class MultifactorAuthenticationTests method newUserPassCredentials.
private static UsernamePasswordCredential newUserPassCredentials(final String user, final String pass) {
final UsernamePasswordCredential userpass = new UsernamePasswordCredential();
userpass.setUsername(user);
userpass.setPassword(pass);
return userpass;
}
Aggregations