protected JwtClaims convertUserProfileIntoClaims(final Map<String, Object> userProfile) {
        val claims = new JwtClaims();
        userProfile
            .entrySet()
            .stream()
            .filter(entry -> !entry.getKey().startsWith(CentralAuthenticationService.NAMESPACE))
            .forEach(entry -> {
                if (OAuth20UserProfileViewRenderer.MODEL_ATTRIBUTE_ATTRIBUTES.equals(entry.getKey())) {
                    val attributes = (Map<String, Object>) entry.getValue();
                    val newAttributes = new HashMap<String, Object>();
                    attributes.forEach((attrName, attrValue) -> newAttributes.put(attrName, determineAttributeValue(attrName, attrValue)));
                    claims.setClaim(entry.getKey(), newAttributes);
                } else {
                    claims.setClaim(entry.getKey(), determineAttributeValue(entry.getKey(), entry.getValue()));
                }
            });
        return claims;
    }
This is {@link OAuth20DefaultUserProfileViewRenderer}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/views/OAuth20DefaultUserProfileViewRenderer.java