use of org.apereo.cas.authentication.DefaultAuthenticationTransactionFactory in project cas by apereo.
the class RegisteredServiceAuthenticationPolicyResolverTests method checkGroovyPolicy.
@Test
public void checkGroovyPolicy() {
val resolver = new RegisteredServiceAuthenticationPolicyResolver(this.servicesManager, new DefaultAuthenticationServiceSelectionPlan(new DefaultAuthenticationServiceSelectionStrategy()));
val transaction = new DefaultAuthenticationTransactionFactory().newTransaction(RegisteredServiceTestUtils.getService("serviceid5"), RegisteredServiceTestUtils.getCredentialsWithSameUsernameAndPassword("casuser"));
val policies = resolver.resolve(transaction);
assertEquals(1, policies.size());
assertTrue(policies.iterator().next() instanceof GroovyScriptAuthenticationPolicy);
}
use of org.apereo.cas.authentication.DefaultAuthenticationTransactionFactory in project cas by apereo.
the class RegisteredServiceAuthenticationPolicyResolverTests method checkAllPolicy.
@Test
public void checkAllPolicy() {
val resolver = new RegisteredServiceAuthenticationPolicyResolver(this.servicesManager, new DefaultAuthenticationServiceSelectionPlan(new DefaultAuthenticationServiceSelectionStrategy()));
val transaction = new DefaultAuthenticationTransactionFactory().newTransaction(RegisteredServiceTestUtils.getService("serviceid3"), RegisteredServiceTestUtils.getCredentialsWithSameUsernameAndPassword("casuser"));
val policies = resolver.resolve(transaction);
assertEquals(1, policies.size());
assertTrue(policies.iterator().next() instanceof AllAuthenticationHandlersSucceededAuthenticationPolicy);
}
use of org.apereo.cas.authentication.DefaultAuthenticationTransactionFactory in project cas by apereo.
the class LdapPasswordSynchronizationConfigurationTests method verifyOperation.
@Test
public void verifyOperation() {
val transaction = new DefaultAuthenticationTransactionFactory().newTransaction(CoreAuthenticationTestUtils.getCredentialsWithSameUsernameAndPassword());
assertFalse(authenticationEventExecutionPlan.getAuthenticationPostProcessors(transaction).isEmpty());
}
use of org.apereo.cas.authentication.DefaultAuthenticationTransactionFactory in project cas by apereo.
the class SamlAuthenticationMetaDataPopulatorTests method verifyAuthenticationTypeFound.
@Test
public void verifyAuthenticationTypeFound() {
val credentials = new UsernamePasswordCredential();
val builder = CoreAuthenticationTestUtils.getAuthenticationBuilder();
this.populator.populateAttributes(builder, new DefaultAuthenticationTransactionFactory().newTransaction(credentials));
val auth = builder.build();
assertEquals(SamlAuthenticationMetaDataPopulator.AUTHN_METHOD_PASSWORD, auth.getAttributes().get(SamlAuthenticationMetaDataPopulator.ATTRIBUTE_AUTHENTICATION_METHOD).get(0));
}
use of org.apereo.cas.authentication.DefaultAuthenticationTransactionFactory in project cas by apereo.
the class SamlAuthenticationMetaDataPopulatorTests method verifyAuthenticationTypeFoundByDefault.
@Test
public void verifyAuthenticationTypeFoundByDefault() {
val credentials = new CustomCredential();
val builder = CoreAuthenticationTestUtils.getAuthenticationBuilder();
this.populator.populateAttributes(builder, new DefaultAuthenticationTransactionFactory().newTransaction(credentials));
val auth = builder.build();
assertNotNull(auth.getAttributes().get(SamlAuthenticationMetaDataPopulator.ATTRIBUTE_AUTHENTICATION_METHOD).get(0));
}
Aggregations