use of org.apereo.cas.authentication.bypass.HttpRequestMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.
the class CasSimpleMultifactorAuthenticationMultifactorProviderBypassConfiguration method casSimpleMultifactorHttpRequestMultifactorAuthenticationProviderBypass.
@ConditionalOnMissingBean(name = "casSimpleMultifactorHttpRequestMultifactorAuthenticationProviderBypass")
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public MultifactorAuthenticationProviderBypassEvaluator casSimpleMultifactorHttpRequestMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
val simple = casProperties.getAuthn().getMfa().getSimple();
val props = simple.getBypass();
return new HttpRequestMultifactorAuthenticationProviderBypassEvaluator(props, simple.getId());
}
use of org.apereo.cas.authentication.bypass.HttpRequestMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.
the class AccepttoMultifactorAuthenticationMultifactorProviderBypassConfiguration method casAccepttoMultifactorHttpRequestMultifactorAuthenticationProviderBypass.
@ConditionalOnMissingBean(name = "casAccepttoMultifactorHttpRequestMultifactorAuthenticationProviderBypass")
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public MultifactorAuthenticationProviderBypassEvaluator casAccepttoMultifactorHttpRequestMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
val simple = casProperties.getAuthn().getMfa().getAcceptto();
val props = simple.getBypass();
return new HttpRequestMultifactorAuthenticationProviderBypassEvaluator(props, simple.getId());
}
use of org.apereo.cas.authentication.bypass.HttpRequestMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.
the class U2FAuthenticationMultifactorProviderBypassConfiguration method u2fHttpRequestMultifactorAuthenticationProviderBypass.
@ConditionalOnMissingBean(name = "u2fHttpRequestMultifactorAuthenticationProviderBypass")
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public MultifactorAuthenticationProviderBypassEvaluator u2fHttpRequestMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
val u2f = casProperties.getAuthn().getMfa().getU2f();
val props = u2f.getBypass();
return new HttpRequestMultifactorAuthenticationProviderBypassEvaluator(props, u2f.getId());
}
use of org.apereo.cas.authentication.bypass.HttpRequestMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.
the class RadiusTokenAuthenticationMultifactorProviderBypassConfiguration method radiusHttpRequestMultifactorAuthenticationProviderBypass.
@ConditionalOnMissingBean(name = "radiusHttpRequestMultifactorAuthenticationProviderBypass")
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public MultifactorAuthenticationProviderBypassEvaluator radiusHttpRequestMultifactorAuthenticationProviderBypass(final CasConfigurationProperties casProperties) {
val radius = casProperties.getAuthn().getMfa().getRadius();
val props = radius.getBypass();
return new HttpRequestMultifactorAuthenticationProviderBypassEvaluator(props, radius.getId());
}
use of org.apereo.cas.authentication.bypass.HttpRequestMultifactorAuthenticationProviderBypassEvaluator in project cas by apereo.
the class MultifactorAuthenticationProviderBypassTests method verifyMultifactorAuthenticationBypassByHttpRequestHeader.
@Test
public void verifyMultifactorAuthenticationBypassByHttpRequestHeader() {
val applicationContext = new StaticApplicationContext();
applicationContext.refresh();
ApplicationContextProvider.holdApplicationContext(applicationContext);
ApplicationContextProvider.registerBeanIntoApplicationContext(applicationContext, MultifactorAuthenticationPrincipalResolver.identical(), UUID.randomUUID().toString());
val request = new MockHttpServletRequest();
request.addHeader("headerbypass", "true");
val props = new MultifactorAuthenticationProviderBypassProperties();
props.setHttpRequestHeaders("headerbypass");
val principal = MultifactorAuthenticationTestUtils.getPrincipal("casuser");
val authentication = MultifactorAuthenticationTestUtils.getAuthentication(principal);
val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(applicationContext);
val bypass = new HttpRequestMultifactorAuthenticationProviderBypassEvaluator(props, provider.getId());
val service = MultifactorAuthenticationTestUtils.getRegisteredService();
assertFalse(bypass.shouldMultifactorAuthenticationProviderExecute(authentication, service, provider, request));
}
Aggregations