@Override
    public Optional<MultifactorAuthenticationProvider> resolve(final HttpServletRequest request,
                                                               final HttpServletResponse response,
                                                               final RegisteredService registeredService,
                                                               final Authentication authentication,
                                                               final Service service) throws Throwable {
        if (registeredService != null && registeredService.getMultifactorAuthenticationPolicy().isBypassEnabled()) {
            LOGGER.debug("Multifactor authentication policy for [{}] will ignore trigger executions", registeredService.getName());
            return Optional.empty();
        }

        for (val trigger : multifactorAuthenticationTriggers) {
            if (BeanSupplier.isNotProxy(trigger) && !trigger.supports(request, registeredService, authentication, service)) {
                continue;
            }
            val activated = trigger.isActivated(authentication, registeredService, request, response, service);
            if (activated.isPresent()) {
                return activated;
            }
        }
        return Optional.empty();
    }
Default MFA Trigger selection strategy.

@author Daniel Frett
@since 5.0.0
core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/DefaultMultifactorAuthenticationTriggerSelectionStrategy.java