@Override
    protected ResponseEntity renderProfileForModel(final Map<String, Object> userProfile,
                                                   final OAuth20AccessToken accessToken,
                                                   final HttpServletResponse response) {
        val service = OAuth20Utils.getRegisteredOAuthServiceByClientId(servicesManager, accessToken.getClientId());
        if (service instanceof final OidcRegisteredService oidcRegisteredService) {
            return FunctionUtils.doAndHandle(() -> {
                if (signingAndEncryptionService.shouldSignToken(oidcRegisteredService)
                    || signingAndEncryptionService.shouldEncryptToken(oidcRegisteredService)) {
                    return signAndEncryptUserProfileClaims(userProfile, response, oidcRegisteredService);
                }
                return buildPlainUserProfileClaims(userProfile, response, oidcRegisteredService);
            }, e -> ResponseEntity.badRequest().body("Unable to produce user profile claims")).get();
        }

        return super.renderProfileForModel(userProfile, accessToken, response);
    }
This is {@link OidcUserProfileViewRenderer}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/profile/OidcUserProfileViewRenderer.java