@Override
    public AuthenticationPolicyExecutionResult isSatisfiedBy(final Authentication authentication,
                                                             final Set<AuthenticationHandler> authenticationHandlers,
                                                             final ConfigurableApplicationContext applicationContext,
                                                             final Map<String, ? extends Serializable> context) throws Exception {
        val fail = authentication.getFailures().values()
            .stream()
            .anyMatch(failure -> failure.getClass().isAssignableFrom(PreventedException.class));
        if (fail) {
            LOGGER.warn("Authentication policy has failed given at least one authentication failure is found to prevent authentication");
            return AuthenticationPolicyExecutionResult.failure();
        }
        return super.isSatisfiedBy(authentication, authenticationHandlers, applicationContext, context);
    }
Authentication policy that defines success as at least one authentication success and no authentication attempts
that were prevented by system errors. This policy may be a desirable alternative to {@link AtLeastOneCredentialValidatedAuthenticationPolicy}
for cases where deployers wish to fail closed for indeterminate security events.

@author Marvin S. Addison
@since 4.0.0
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/policy/NotPreventedAuthenticationPolicy.java