@Override
    protected MultifactorAuthenticationProvider selectMultifactorAuthenticationProvider(
        final RegisteredService service,
        final List<MultifactorAuthenticationProvider> providers) {

        if (providers.size() > 1) {
            val provider = new DefaultChainingMultifactorAuthenticationProvider(applicationContext, failureModeEvaluator);
            provider.addMultifactorAuthenticationProviders(providers);
            return provider;
        }
        return super.selectMultifactorAuthenticationProvider(service, providers);
    }
This is {@link ChainingMultifactorAuthenticationProviderSelector}.

@author Misagh Moayyed
@since 6.1.0
core/cas-server-core-webflow-mfa-api/src/main/java/org/apereo/cas/web/flow/authentication/ChainingMultifactorAuthenticationProviderSelector.java