use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourcePasswordManagementServiceTests method verifyPasswordValidationService.
@Test
public void verifyPasswordValidationService() {
final UsernamePasswordCredential c = new UsernamePasswordCredential("casuser", "password");
final PasswordChangeBean bean = new PasswordChangeBean();
bean.setConfirmedPassword("Test@1234");
bean.setPassword("Test@1234");
final boolean isValid = passwordValidationService.isValid(c, bean);
assertTrue(isValid);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JsonResourcePasswordManagementServiceTests method verifyUserPasswordChange.
@Test
public void verifyUserPasswordChange() {
final Credential c = new UsernamePasswordCredential("casuser", "password");
final PasswordChangeBean bean = new PasswordChangeBean();
bean.setConfirmedPassword("newPassword");
bean.setPassword("newPassword");
final boolean res = passwordChangeService.change(c, bean);
assertTrue(res);
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class SamlAuthenticationMetaDataPopulatorTests method verifyAuthenticationTypeFound.
@Test
public void verifyAuthenticationTypeFound() {
final UsernamePasswordCredential credentials = new UsernamePasswordCredential();
final AuthenticationBuilder builder = CoreAuthenticationTestUtils.getAuthenticationBuilder();
this.populator.populateAttributes(builder, AuthenticationTransaction.of(credentials));
final Authentication auth = builder.build();
assertEquals(SamlAuthenticationMetaDataPopulator.AUTHN_METHOD_PASSWORD, auth.getAttributes().get(SamlAuthenticationMetaDataPopulator.ATTRIBUTE_AUTHENTICATION_METHOD));
}
use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class JdbcThrottledSubmissionHandlerInterceptorAdapterTests 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 SearchModeSearchDatabaseAuthenticationHandlerTests method verifyNotFoundUser.
@Test
public void verifyNotFoundUser() throws Exception {
final UsernamePasswordCredential c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("hello", "world");
this.thrown.expect(FailedLoginException.class);
this.handler.authenticate(c);
}
Aggregations