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());
}
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());
}
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());
}
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());
}
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));
}
Aggregations