use of org.apereo.cas.authentication.UsernamePasswordCredential in project cas by apereo.
the class Cas30ResponseViewTests method verifyPasswordAsAuthenticationAttributeCanDecrypt.
@Test
public void verifyPasswordAsAuthenticationAttributeCanDecrypt() throws Exception {
final Map<?, ?> attributes = renderView();
assertTrue(attributes.containsKey(CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL));
final String encodedPsw = (String) attributes.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL);
final String password = decryptCredential(encodedPsw);
final UsernamePasswordCredential creds = CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword();
assertEquals(password, creds.getPassword());
}
Aggregations