Search in sources :

Example 1 with AuthenticationAttributeMultifactorAuthenticationTrigger

use of org.apereo.cas.authentication.mfa.trigger.AuthenticationAttributeMultifactorAuthenticationTrigger in project cas by apereo.

the class DefaultMultifactorAuthenticationProviderResolverTests method verifyMultipleProvidersWithAuthenticationAttributes.

@Test
public void verifyMultipleProvidersWithAuthenticationAttributes() {
    val applicationContext = new StaticApplicationContext();
    applicationContext.refresh();
    val casProperties = new CasConfigurationProperties();
    casProperties.getAuthn().getMfa().getTriggers().getAuthentication().setGlobalAuthenticationAttributeNameTriggers("mfa-authn");
    val resolver = new DefaultMultifactorAuthenticationProviderResolver(MultifactorAuthenticationPrincipalResolver.identical());
    val trigger = new AuthenticationAttributeMultifactorAuthenticationTrigger(casProperties, resolver, applicationContext);
    assertProviderResolutionFromManyProviders(trigger, applicationContext, true);
}
Also used : lombok.val(lombok.val) StaticApplicationContext(org.springframework.context.support.StaticApplicationContext) AuthenticationAttributeMultifactorAuthenticationTrigger(org.apereo.cas.authentication.mfa.trigger.AuthenticationAttributeMultifactorAuthenticationTrigger) CasConfigurationProperties(org.apereo.cas.configuration.CasConfigurationProperties) Test(org.junit.jupiter.api.Test)

Aggregations

lombok.val (lombok.val)1 AuthenticationAttributeMultifactorAuthenticationTrigger (org.apereo.cas.authentication.mfa.trigger.AuthenticationAttributeMultifactorAuthenticationTrigger)1 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)1 Test (org.junit.jupiter.api.Test)1 StaticApplicationContext (org.springframework.context.support.StaticApplicationContext)1