@Override
    public MultifactorAuthenticationContextValidationResult validate(final Authentication authentication,
                                                                     final String requestedContext,
                                                                     final Optional<RegisteredService> service) {
        val providerMap = MultifactorAuthenticationUtils.getAvailableMultifactorAuthenticationProviders(this.applicationContext);
        LOGGER.trace("Available multifactor providers are [{}]", providerMap.values());

        LOGGER.trace("Attempting to match requested authentication context [{}] against [{}]", requestedContext, providerMap.keySet());
        val requestedProvider = locateRequestedProvider(providerMap.values(), requestedContext);
        if (requestedProvider.isEmpty()) {
            LOGGER.debug("Requested authentication provider cannot be recognized.");
            return MultifactorAuthenticationContextValidationResult.builder().success(false).provider(requestedProvider).build();
        }

        val authnContextAttributes = org.springframework.util.StringUtils.commaDelimitedListToSet(authenticationContextAttribute);
        val attributes = authentication.getAttributes();
        for (val authnContextAttribute : authnContextAttributes) {
            val ctxAttr = attributes.get(authnContextAttribute);
            val contexts = CollectionUtils.toCollection(ctxAttr);

            LOGGER.debug("Requested context is [{}] and available contexts are [{}]", requestedContext, contexts);
            if (contexts.stream().anyMatch(ctx -> StringUtils.equalsIgnoreCase(ctx.toString(), requestedContext))) {
                LOGGER.debug("Requested authentication context [{}] is satisfied", requestedContext);
                return MultifactorAuthenticationContextValidationResult.builder()
                    .success(true).provider(requestedProvider).build();
            }
            if (StringUtils.isNotBlank(this.mfaTrustedAuthnAttributeName) && attributes.containsKey(this.mfaTrustedAuthnAttributeName)) {
                LOGGER.debug("Requested authentication context [{}] is satisfied since device is already trusted", requestedContext);
                return MultifactorAuthenticationContextValidationResult
                    .builder()
                    .success(true)
                    .provider(requestedProvider)
                    .build();
            }
            val provider = requestedProvider.get();
            val satisfiedProviders = getSatisfiedAuthenticationProviders(authentication, providerMap.values());
            if (satisfiedProviders != null && !satisfiedProviders.isEmpty()) {
                val providers = satisfiedProviders.toArray(MultifactorAuthenticationProvider[]::new);
                OrderComparator.sortIfNecessary(providers);
                LOGGER.debug("Satisfied authentication context(s) are [{}]", satisfiedProviders);

                val result = Arrays.stream(providers)
                    .filter(p -> p.equals(provider) || p.getOrder() >= provider.getOrder())
                    .findFirst();
                if (result.isPresent()) {
                    LOGGER.debug("Current provider [{}] already satisfies the authentication requirements of [{}]; proceed with flow normally.",
                        result.get(), requestedProvider);
                    return MultifactorAuthenticationContextValidationResult.builder()
                        .success(true).provider(requestedProvider).build();
                }
            }
        }
        LOGGER.info("No multifactor providers could be located to satisfy the requested context for [{}]", requestedContext);
        return MultifactorAuthenticationContextValidationResult.builder().success(false).provider(requestedProvider).build();
    }
{@inheritDoc}
If the authentication event is established as part trusted/device browser
such that MFA was skipped, allow for validation to execute successfully.
If authentication event did bypass MFA, allow for validation to execute successfully.

@param authentication   the authentication
@param requestedContext the requested context
@param service          the service
@return validation result
core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/DefaultMultifactorAuthenticationContextValidator.java