protected Pair<String, Object> mapClaimToAttribute(final String claim,
                                                       final RegisteredServiceAttributeReleasePolicyContext context,
                                                       final Map<String, List<Object>> resolvedAttributes) throws Throwable {
        val mappedClaimResult = getMappedClaim(claim, context);
        if (mappedClaimResult.isPresent()) {
            val mappedAttr = mappedClaimResult.get();
            LOGGER.trace("Attribute [{}] is mapped to claim [{}]", mappedAttr, claim);

            val scriptFactoryInstance = ExecutableCompiledScriptFactory.findExecutableCompiledScriptFactory();

            if (scriptFactoryInstance.isPresent() && scriptFactoryInstance.get().isInlineScript(mappedAttr)) {
                val script = scriptFactoryInstance.get().getInlineScript(mappedAttr).orElseThrow();
                LOGGER.trace("Locating attribute value via script [{}] for definition [{}]", script, claim);
                try (val cacheManager = ApplicationContextProvider.getScriptResourceCacheManager()
                    .orElseThrow(() -> new IllegalArgumentException("No groovy script cache manager is available to execute claim mappings"))) {
                    val scriptResource = cacheManager.resolveScriptableResource(script, mappedAttr);
                    val args = Map.of("attributes", resolvedAttributes, "context", context, "logger", LOGGER);
                    scriptResource.setBinding(args);
                    val result = scriptResource.execute(args.values().toArray(), Object.class);
                    LOGGER.debug("Mapped attribute [{}] to [{}] from script", claim, result);
                    return Pair.of(claim, result);
                }
            }

            if (resolvedAttributes.containsKey(mappedAttr)) {
                val value = resolvedAttributes.get(mappedAttr);
                LOGGER.debug("Found mapped attribute [{}] with value [{}] for claim [{}]", mappedAttr, value, claim);
                return Pair.of(claim, value);
            }
            if (resolvedAttributes.containsKey(claim)) {
                val value = resolvedAttributes.get(claim);
                LOGGER.debug("CAS is unable to find the attribute [{}] that is mapped to claim [{}]. "
                        + "However, since resolved attributes [{}] already contain this claim, "
                        + "CAS will use [{}] with value(s) [{}]",
                    mappedAttr, claim, resolvedAttributes, claim, value);
                return Pair.of(claim, value);
            }
            LOGGER.warn("Located claim [{}] mapped to attribute [{}], yet "
                    + "resolved attributes [{}] do not contain attribute [{}]",
                claim, mappedAttr, resolvedAttributes, mappedAttr);
        }

        val value = resolvedAttributes.get(claim);
        LOGGER.debug("No mapped attribute is defined for claim [{}]; Used [{}] to locate value [{}]", claim, claim, value);
        return Pair.of(claim, value);
    }
This is {@link BaseOidcScopeAttributeReleasePolicy}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-oidc-core/src/main/java/org/apereo/cas/oidc/claims/BaseOidcScopeAttributeReleasePolicy.java