@Override
    public Optional<MultifactorAuthenticationProvider> isActivated(final Authentication authentication,
                                                                   final RegisteredService registeredService,
                                                                   final HttpServletRequest httpServletRequest,
                                                                   final HttpServletResponse response,
                                                                   final Service service) {
        if (authentication == null) {
            LOGGER.debug("No authentication is available to determine event for principal");
            return Optional.empty();
        }

        val values = resolveEventFromHttpRequest(httpServletRequest);
        if (values != null && !values.isEmpty()) {
            LOGGER.debug("Received request as [{}]", values);

            val providerMap = MultifactorAuthenticationUtils.getAvailableMultifactorAuthenticationProviders(this.applicationContext);
            if (providerMap.isEmpty()) {
                LOGGER.error("No multifactor authentication providers are available in the application context to satisfy [{}]", values);
                throw new AuthenticationException(new MultifactorAuthenticationProviderAbsentException());
            }

            val providerFound = MultifactorAuthenticationUtils.resolveProvider(providerMap, values.getFirst());
            if (providerFound.isPresent()) {
                return providerFound;
            }

            LOGGER.warn("No multifactor provider could be found for request parameter [{}]", values);
            throw new AuthenticationException();
        }
        return Optional.empty();
    }
This is {@link HttpRequestMultifactorAuthenticationTrigger}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/mfa/trigger/HttpRequestMultifactorAuthenticationTrigger.java