protected Optional<MultifactorAuthenticationProvider> determineMultifactorAuthenticationProvider(
        final RegisteredService registeredService,
        final Authentication authentication,
        final HttpServletRequest request,
        final HttpServletResponse response,
        final Service service) throws Throwable {
        if (registeredService != null && registeredService.getMultifactorAuthenticationPolicy().isBypassEnabled()) {
            return Optional.empty();
        }
        if (multifactorAuthenticationTrigger.supports(request, registeredService, authentication, service)) {
            return multifactorAuthenticationTrigger.isActivated(authentication, registeredService, request, response, service);
        }
        return Optional.empty();
    }
This is {@link DefaultMultifactorAuthenticationProviderWebflowEventResolver}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core-webflow-mfa-api/src/main/java/org/apereo/cas/web/flow/resolver/impl/mfa/DefaultMultifactorAuthenticationProviderWebflowEventResolver.java