private Principal buildPrincipalForAttributeFilter(final OAuth20Token token,
                                                       final RegisteredService registeredService) throws Throwable {
        val authentication = token.getAuthentication();
        val attributes = new HashMap<>(authentication.getPrincipal().getAttributes());
        val authnAttributes = configurationContext.getAuthenticationAttributeReleasePolicy()
            .getAuthenticationAttributesForRelease(authentication, registeredService);
        attributes.putAll(authnAttributes);
        return configurationContext.getPrincipalFactory().createPrincipal(authentication.getPrincipal().getId(), attributes);
    }
This is {@link OAuth20JwtAccessTokenEncodableCipher}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/accesstoken/response/OAuth20JwtAccessTokenEncodableCipher.java