@Override
    protected void prepareApprovalViewModel(final Map<String, Object> model,
                                            final WebContext webContext,
                                            final OAuthRegisteredService registeredService) throws Exception {
        super.prepareApprovalViewModel(model, webContext, registeredService);
        if (registeredService instanceof final OidcRegisteredService oidcRegisteredService) {

            val dynamicRegistrationPropName = RegisteredServiceProperties.OIDC_DYNAMIC_CLIENT_REGISTRATION.getPropertyName();
            if (oidcRegisteredService.getProperties().containsKey(dynamicRegistrationPropName)) {
                val dynamic = oidcRegisteredService.getProperties().get(dynamicRegistrationPropName).getBooleanValue();
                model.put("dynamic", dynamic);
                model.put("dynamicTime", oidcRegisteredService.getProperties()
                    .get(RegisteredServiceProperties.OIDC_DYNAMIC_CLIENT_REGISTRATION_DATE.getPropertyName()).getValue(String.class));
            }
            val supportedScopes = new HashSet<>(casProperties.getAuthn().getOidc().getDiscovery().getScopes());
            supportedScopes.retainAll(oidcRegisteredService.getScopes());

            val requestedScopes = oauthRequestParameterResolver.resolveRequestedScopes(webContext);
            val userInfoClaims = oauthRequestParameterResolver.resolveUserInfoRequestClaims(webContext);
            webContext.getRequestParameter(OidcConstants.REQUEST_URI).ifPresent(Unchecked.consumer(uri -> {
                val authzRequest = ticketRegistry.getTicket(uri, OidcPushedAuthorizationRequest.class);
                val uriFactory = (OidcPushedAuthorizationRequestFactory) ticketFactory.get(OidcPushedAuthorizationRequest.class);
                val holder = uriFactory.toAccessTokenRequest(authzRequest);
                userInfoClaims.addAll(holder.getClaims().keySet());
                requestedScopes.addAll(holder.getScopes());
            }));
            supportedScopes.retainAll(requestedScopes);
            supportedScopes.add(OidcConstants.StandardScopes.OPENID.getScope());
            model.put("scopes", supportedScopes);
            model.put("userInfoClaims", userInfoClaims);
        }
    }
This is {@link OidcConsentApprovalViewResolver}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/web/OidcConsentApprovalViewResolver.java