Search in sources :

Example 6 with PrincipalMultifactorAuthenticationProviderBypassEvaluator

use of org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.

the class RadiusTokenAuthenticationMultifactorProviderBypassConfiguration method radiusPrincipalMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "radiusPrincipalMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator radiusPrincipalMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val radius = casProperties.getAuthn().getMfa().getRadius();
    val props = radius.getBypass();
    return new PrincipalMultifactorAuthenticationProviderBypassEvaluator(props, radius.getId());
}
Also used : lombok.val(lombok.val) PrincipalMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 7 with PrincipalMultifactorAuthenticationProviderBypassEvaluator

use of org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.

the class MultifactorAuthenticationProviderBypassTests method verifyMultifactorAuthenticationBypassByPrincipalAttributes.

@Test
public void verifyMultifactorAuthenticationBypassByPrincipalAttributes() {
    val applicationContext = new StaticApplicationContext();
    applicationContext.refresh();
    ApplicationContextProvider.holdApplicationContext(applicationContext);
    ApplicationContextProvider.registerBeanIntoApplicationContext(applicationContext, MultifactorAuthenticationPrincipalResolver.identical(), UUID.randomUUID().toString());
    val request = new MockHttpServletRequest();
    val props = new MultifactorAuthenticationProviderBypassProperties();
    props.setPrincipalAttributeName("givenName");
    props.setPrincipalAttributeValue("CAS");
    val principal = MultifactorAuthenticationTestUtils.getPrincipal("casuser", CollectionUtils.wrap("givenName", "CAS"));
    val authentication = MultifactorAuthenticationTestUtils.getAuthentication(principal, CollectionUtils.wrap("authnFlag", "bypass"));
    val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
    val bypass = new PrincipalMultifactorAuthenticationProviderBypassEvaluator(props, provider.getId());
    val service = MultifactorAuthenticationTestUtils.getRegisteredService();
    assertFalse(bypass.shouldMultifactorAuthenticationProviderExecute(authentication, service, provider, request));
}
Also used : lombok.val(lombok.val) MultifactorAuthenticationProviderBypassProperties(org.apereo.cas.configuration.model.support.mfa.MultifactorAuthenticationProviderBypassProperties) StaticApplicationContext(org.springframework.context.support.StaticApplicationContext) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) PrincipalMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator) Test(org.junit.jupiter.api.Test)

Example 8 with PrincipalMultifactorAuthenticationProviderBypassEvaluator

use of org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.

the class AuthyAuthenticationMultifactorProviderBypassConfiguration method authyPrincipalMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "authyPrincipalMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator authyPrincipalMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val authy = casProperties.getAuthn().getMfa().getAuthy();
    val props = authy.getBypass();
    return new PrincipalMultifactorAuthenticationProviderBypassEvaluator(props, authy.getId());
}
Also used : lombok.val(lombok.val) PrincipalMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 9 with PrincipalMultifactorAuthenticationProviderBypassEvaluator

use of org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.

the class WebAuthnMultifactorProviderBypassConfiguration method webAuthnPrincipalMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "webAuthnPrincipalMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator webAuthnPrincipalMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val webAuthn = casProperties.getAuthn().getMfa().getWebAuthn();
    val props = webAuthn.getBypass();
    return new PrincipalMultifactorAuthenticationProviderBypassEvaluator(props, webAuthn.getId());
}
Also used : lombok.val(lombok.val) PrincipalMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 10 with PrincipalMultifactorAuthenticationProviderBypassEvaluator

use of org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.

the class InweboAuthenticationMultifactorProviderBypassConfiguration method inweboPrincipalMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "inweboPrincipalMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator inweboPrincipalMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val inwebo = casProperties.getAuthn().getMfa().getInwebo();
    val props = inwebo.getBypass();
    return new PrincipalMultifactorAuthenticationProviderBypassEvaluator(props, inwebo.getId());
}
Also used : lombok.val(lombok.val) PrincipalMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

lombok.val (lombok.val)12 PrincipalMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator)12 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)11 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)11 Bean (org.springframework.context.annotation.Bean)11 StringUtils (org.apache.commons.lang3.StringUtils)1 DuoSecurityAuthenticationService (org.apereo.cas.adaptors.duo.authn.DuoSecurityAuthenticationService)1 AuthenticationMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.AuthenticationMultifactorAuthenticationProviderBypassEvaluator)1 ChainingMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.ChainingMultifactorAuthenticationProviderBypassEvaluator)1 CredentialMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.CredentialMultifactorAuthenticationProviderBypassEvaluator)1 DefaultChainingMultifactorAuthenticationBypassProvider (org.apereo.cas.authentication.bypass.DefaultChainingMultifactorAuthenticationBypassProvider)1 GroovyMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.GroovyMultifactorAuthenticationProviderBypassEvaluator)1 HttpRequestMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.HttpRequestMultifactorAuthenticationProviderBypassEvaluator)1 MultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.MultifactorAuthenticationProviderBypassEvaluator)1 NeverAllowMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.NeverAllowMultifactorAuthenticationProviderBypassEvaluator)1 RegisteredServiceMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.RegisteredServiceMultifactorAuthenticationProviderBypassEvaluator)1 RegisteredServicePrincipalAttributeMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.RegisteredServicePrincipalAttributeMultifactorAuthenticationProviderBypassEvaluator)1 RestMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.RestMultifactorAuthenticationProviderBypassEvaluator)1 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)1 MultifactorAuthenticationProviderBypassProperties (org.apereo.cas.configuration.model.support.mfa.MultifactorAuthenticationProviderBypassProperties)1