@Override
    public AuthenticationPolicyExecutionResult isSatisfiedBy(final Authentication authentication,
                                                             final Set<AuthenticationHandler> authenticationHandlers,
                                                             final ConfigurableApplicationContext applicationContext,
                                                             final Map<String, ? extends Serializable> context) {
        val allAttributes = CoreAuthenticationUtils.mergeAttributes(authentication.getAttributes(),
            authentication.getPrincipal().getAttributes());
        val result = requiredAttributes.entrySet().stream().allMatch(entry -> {
            var foundAttribute = allAttributes.containsKey(entry.getKey());
            if (foundAttribute) {
                val attributeValues = allAttributes.get(entry.getKey());
                foundAttribute = RegexUtils.findFirst(entry.getValue(), attributeValues).isPresent();
            }
            return foundAttribute;
        });
        return AuthenticationPolicyExecutionResult.success(result);
    }
Authentication security policy that is satisfied iff
required attributes are found in {@link Authentication}
or {@link org.apereo.cas.authentication.principal.Principal}.

@author Misagh Moayyed
@since 7.0.0
core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/policy/RequiredAttributesAuthenticationPolicy.java