Search in sources :

Example 1 with CredentialMultifactorAuthenticationProviderBypassEvaluator

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

the class CasSimpleMultifactorAuthenticationMultifactorProviderBypassConfiguration method casSimpleMultifactorCredentialMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "casSimpleMultifactorCredentialMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator casSimpleMultifactorCredentialMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val simple = casProperties.getAuthn().getMfa().getSimple();
    val props = simple.getBypass();
    return new CredentialMultifactorAuthenticationProviderBypassEvaluator(props, simple.getId());
}
Also used : lombok.val(lombok.val) CredentialMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.CredentialMultifactorAuthenticationProviderBypassEvaluator) 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 2 with CredentialMultifactorAuthenticationProviderBypassEvaluator

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

the class SwivelAuthenticationMultifactorProviderBypassConfiguration method swivelCredentialMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "swivelCredentialMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator swivelCredentialMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val swivel = casProperties.getAuthn().getMfa().getSwivel();
    val props = swivel.getBypass();
    return new CredentialMultifactorAuthenticationProviderBypassEvaluator(props, swivel.getId());
}
Also used : lombok.val(lombok.val) CredentialMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.CredentialMultifactorAuthenticationProviderBypassEvaluator) 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 3 with CredentialMultifactorAuthenticationProviderBypassEvaluator

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

the class U2FAuthenticationMultifactorProviderBypassConfiguration method u2fCredentialMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "u2fCredentialMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator u2fCredentialMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val u2f = casProperties.getAuthn().getMfa().getU2f();
    val props = u2f.getBypass();
    return new CredentialMultifactorAuthenticationProviderBypassEvaluator(props, u2f.getId());
}
Also used : lombok.val(lombok.val) CredentialMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.CredentialMultifactorAuthenticationProviderBypassEvaluator) 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 4 with CredentialMultifactorAuthenticationProviderBypassEvaluator

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

the class YubiKeyAuthenticationMultifactorProviderBypassConfiguration method yubikeyCredentialMultifactorAuthenticationProviderBypass.

@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
@ConditionalOnMissingBean(name = "yubikeyCredentialMultifactorAuthenticationProviderBypass")
public MultifactorAuthenticationProviderBypassEvaluator yubikeyCredentialMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
    val yubikey = casProperties.getAuthn().getMfa().getYubikey();
    val props = yubikey.getBypass();
    return new CredentialMultifactorAuthenticationProviderBypassEvaluator(props, yubikey.getId());
}
Also used : lombok.val(lombok.val) CredentialMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.CredentialMultifactorAuthenticationProviderBypassEvaluator) 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 5 with CredentialMultifactorAuthenticationProviderBypassEvaluator

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

the class MultifactorAuthenticationProviderBypassTests method verifyMultifactorAuthenticationBypassByAuthenticationCredentialClass.

@Test
public void verifyMultifactorAuthenticationBypassByAuthenticationCredentialClass() {
    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.setCredentialClassType(Credential.class.getName());
    val principal = MultifactorAuthenticationTestUtils.getPrincipal("casuser");
    val authentication = MultifactorAuthenticationTestUtils.getAuthentication(principal);
    val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
    val bypass = new CredentialMultifactorAuthenticationProviderBypassEvaluator(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) Credential(org.apereo.cas.authentication.Credential) StaticApplicationContext(org.springframework.context.support.StaticApplicationContext) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) CredentialMultifactorAuthenticationProviderBypassEvaluator(org.apereo.cas.authentication.bypass.CredentialMultifactorAuthenticationProviderBypassEvaluator) Test(org.junit.jupiter.api.Test)

Aggregations

lombok.val (lombok.val)12 CredentialMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.CredentialMultifactorAuthenticationProviderBypassEvaluator)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 Credential (org.apereo.cas.authentication.Credential)1 AuthenticationMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.AuthenticationMultifactorAuthenticationProviderBypassEvaluator)1 ChainingMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.ChainingMultifactorAuthenticationProviderBypassEvaluator)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 PrincipalMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.PrincipalMultifactorAuthenticationProviderBypassEvaluator)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