@Override
    public Map<String, BaseOidcScopeAttributeReleasePolicy> resolvePolicies(final OidcRegisteredService registeredService) {
        val policies = new HashMap<>(attributeReleasePoliciesByScope);

        val userScopes = getUserDefinedScopes();
        LOGGER.debug("Configuring attributes release policies for user-defined scopes [{}]", userScopes);
        userScopes.forEach(us -> policies.put(us.getScopeName(), us));

        LOGGER.debug("Configuring attributes release policies for user-defined scopes specified for service [{}]", registeredService.getName());
        val listOfOidcPolicies = new ArrayList<OidcRegisteredServiceAttributeReleasePolicy>();
        if (registeredService.getAttributeReleasePolicy() instanceof final ChainingAttributeReleasePolicy chain) {
            listOfOidcPolicies.addAll(chain.getPolicies()
                .stream()
                .filter(OidcRegisteredServiceAttributeReleasePolicy.class::isInstance)
                .map(OidcRegisteredServiceAttributeReleasePolicy.class::cast)
                .toList());
        } else if (registeredService.getAttributeReleasePolicy() instanceof final OidcRegisteredServiceAttributeReleasePolicy policy) {
            listOfOidcPolicies.add(policy);
        }
        listOfOidcPolicies
            .stream()
            .filter(OidcCustomScopeAttributeReleasePolicy.class::isInstance)
            .map(OidcCustomScopeAttributeReleasePolicy.class::cast)
            .filter(policy -> !policies.containsKey(policy.getScopeName()))
            .forEach(policy -> policies.put(policy.getScopeName(), policy));
        listOfOidcPolicies
            .stream()
            .filter(OidcScopeFreeAttributeReleasePolicy.class::isInstance)
            .map(OidcScopeFreeAttributeReleasePolicy.class::cast)
            .forEach(policy -> policies.put(UUID.randomUUID().toString(), policy));

        LOGGER.debug("Final set of scopes mapped to attribute release policies are [{}]", policies.keySet());
        return policies;
    }
This is {@link DefaultOidcAttributeReleasePolicyFactory}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/scopes/DefaultOidcAttributeReleasePolicyFactory.java