@Bean
        @ConditionalOnMissingBean(name = "globalAuthenticationPolicy")
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        public AuthenticationPolicy globalAuthenticationPolicy(final CasConfigurationProperties casProperties) {
            if (casProperties.getAuthn().getPolicy().isRequiredHandlerAuthenticationPolicyEnabled()) {
                LOGGER.trace("Applying configuration for Required Handler Authentication Policy");
                return (authentication, handlers, applicationContext, context) -> {
                    val registeredService = (RegisteredService) context.get(RegisteredService.class.getName());
                    val requiredHandlers = registeredService.getAuthenticationPolicy().getRequiredAuthenticationHandlers();
                    LOGGER.debug("Required authentication handlers for this service [{}] are [{}]",
                        registeredService.getName(), requiredHandlers);
                    val success = requiredHandlers
                        .stream()
                        .allMatch(required -> authentication.getSuccesses().containsKey(required));
                    return AuthenticationPolicyExecutionResult.success(success);
                };
            }
            return AuthenticationPolicy.alwaysSatisfied();
        }
This is {@link CasCoreAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
core/cas-server-core/src/main/java/org/apereo/cas/config/CasCoreConfiguration.java