protected boolean isClaimReleasedAllowedByScopeFreePolicy(final String claimName, final RegisteredService registeredService) {
        if (registeredService.getAttributeReleasePolicy() instanceof final OidcScopeFreeAttributeReleasePolicy policy) {
            val allowedAttributes = policy.getAllowedAttributes();
            LOGGER.trace("Checking if claim [{}] is allowed by the scope-free policy [{}]", claimName, allowedAttributes);
            return !policy.claimsMustBeDefinedViaDiscovery() && allowedAttributes.contains(claimName);
        }
        if (registeredService.getAttributeReleasePolicy() instanceof final RegisteredServiceChainingAttributeReleasePolicy chain) {
            return chain
                .getPolicies()
                .stream()
                .filter(OidcScopeFreeAttributeReleasePolicy.class::isInstance)
                .map(OidcScopeFreeAttributeReleasePolicy.class::cast)
                .filter(policy -> !policy.claimsMustBeDefinedViaDiscovery())
                .anyMatch(policy -> policy.getAllowedAttributes().contains(claimName));
        }
        return false;
    }
This is {@link OidcIdTokenGeneratorService}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/token/OidcIdTokenGeneratorService.java