Search in sources :

Example 6 with AuthenticationPolicyProperties

use of org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties in project cas by apereo.

the class CoreAuthenticationUtilsTests method verifyNoAuthPolicy.

@Test
public void verifyNoAuthPolicy() {
    val props = new AuthenticationPolicyProperties();
    props.getAny().setEnabled(false);
    props.getNotPrevented().setEnabled(false);
    assertTrue(CoreAuthenticationUtils.newAuthenticationPolicy(props).isEmpty());
}
Also used : lombok.val(lombok.val) RestAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.RestAuthenticationPolicyProperties) AuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties) GroovyAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.GroovyAuthenticationPolicyProperties) Test(org.junit.jupiter.api.Test)

Example 7 with AuthenticationPolicyProperties

use of org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties in project cas by apereo.

the class CoreAuthenticationUtilsTests method verifyAuthnPolicyRest.

@Test
public void verifyAuthnPolicyRest() throws Exception {
    val props = new AuthenticationPolicyProperties();
    val rest = new RestAuthenticationPolicyProperties();
    rest.setUrl("http://example.org");
    props.getRest().add(rest);
    val policy = CoreAuthenticationUtils.newAuthenticationPolicy(props);
    verifySerialization(policy);
}
Also used : lombok.val(lombok.val) RestAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.RestAuthenticationPolicyProperties) RestAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.RestAuthenticationPolicyProperties) AuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties) GroovyAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.GroovyAuthenticationPolicyProperties) Test(org.junit.jupiter.api.Test)

Example 8 with AuthenticationPolicyProperties

use of org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties in project cas by apereo.

the class CoreAuthenticationUtilsTests method verifyAuthnPolicyAllHandlers.

@Test
public void verifyAuthnPolicyAllHandlers() throws Exception {
    val props = new AuthenticationPolicyProperties();
    props.getAllHandlers().setEnabled(true);
    val policy = CoreAuthenticationUtils.newAuthenticationPolicy(props);
    verifySerialization(policy);
}
Also used : lombok.val(lombok.val) RestAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.RestAuthenticationPolicyProperties) AuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties) GroovyAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.GroovyAuthenticationPolicyProperties) Test(org.junit.jupiter.api.Test)

Example 9 with AuthenticationPolicyProperties

use of org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties in project cas by apereo.

the class CoreAuthenticationUtilsTests method verifyAuthnPolicyRequired.

@Test
public void verifyAuthnPolicyRequired() throws Exception {
    val props = new AuthenticationPolicyProperties();
    props.getReq().setEnabled(true);
    val policy = CoreAuthenticationUtils.newAuthenticationPolicy(props);
    verifySerialization(policy);
}
Also used : lombok.val(lombok.val) RestAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.RestAuthenticationPolicyProperties) AuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties) GroovyAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.GroovyAuthenticationPolicyProperties) Test(org.junit.jupiter.api.Test)

Example 10 with AuthenticationPolicyProperties

use of org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties in project cas by apereo.

the class CoreAuthenticationUtilsTests method verifyAuthnPolicyNotPrevented.

@Test
public void verifyAuthnPolicyNotPrevented() throws Exception {
    val props = new AuthenticationPolicyProperties();
    props.getNotPrevented().setEnabled(true);
    val policy = CoreAuthenticationUtils.newAuthenticationPolicy(props);
    verifySerialization(policy);
}
Also used : lombok.val(lombok.val) RestAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.RestAuthenticationPolicyProperties) AuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties) GroovyAuthenticationPolicyProperties(org.apereo.cas.configuration.model.core.authentication.GroovyAuthenticationPolicyProperties) Test(org.junit.jupiter.api.Test)

Aggregations

AuthenticationPolicyProperties (org.apereo.cas.configuration.model.core.authentication.AuthenticationPolicyProperties)10 lombok.val (lombok.val)9 GroovyAuthenticationPolicyProperties (org.apereo.cas.configuration.model.core.authentication.GroovyAuthenticationPolicyProperties)8 RestAuthenticationPolicyProperties (org.apereo.cas.configuration.model.core.authentication.RestAuthenticationPolicyProperties)8 Test (org.junit.jupiter.api.Test)8 Slf4j (lombok.extern.slf4j.Slf4j)2 GroovyScriptAuthenticationPolicy (org.apereo.cas.authentication.policy.GroovyScriptAuthenticationPolicy)2 NotPreventedAuthenticationPolicy (org.apereo.cas.authentication.policy.NotPreventedAuthenticationPolicy)2 RestfulAuthenticationPolicy (org.apereo.cas.authentication.policy.RestfulAuthenticationPolicy)2 ApplicationContext (org.springframework.context.ApplicationContext)2 Splitter (com.google.common.base.Splitter)1 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)1 Multimap (com.google.common.collect.Multimap)1 GroovyClassLoader (groovy.lang.GroovyClassLoader)1 StandardCharsets (java.nio.charset.StandardCharsets)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1