public static OidcClientRegistrationResponse getClientRegistrationResponse(final OidcRegisteredService registeredService,
                                                                               final String serverPrefix) {
        val clientResponse = new OidcClientRegistrationResponse();
        clientResponse.setApplicationType(registeredService.getApplicationType());
        clientResponse.setClientId(registeredService.getClientId());
        clientResponse.setClientSecret(registeredService.getClientSecret());
        clientResponse.setSubjectType(registeredService.getSubjectType());
        clientResponse.setTokenEndpointAuthMethod(registeredService.getTokenEndpointAuthenticationMethod());
        clientResponse.setClientName(registeredService.getName());
        clientResponse.setRedirectUris(CollectionUtils.wrap(registeredService.getServiceId()));
        clientResponse.setUserInfoSignedResponseAlg(registeredService.getUserInfoSigningAlg());
        clientResponse.setUserInfoEncryptedResponseAlg(registeredService.getUserInfoEncryptedResponseAlg());
        clientResponse.setUserInfoEncryptedResponseEncoding(registeredService.getUserInfoEncryptedResponseEncoding());

        clientResponse.setContacts(
            registeredService.getContacts()
                .stream()
                .map(contact -> StringUtils.defaultIfBlank(contact.getEmail(), contact.getName()))
                .filter(StringUtils::isNotBlank)
                .collect(Collectors.toList())
        );
        clientResponse.setGrantTypes(
            Arrays.stream(OAuth20GrantTypes.values())
                .map(type -> type.getType().toLowerCase(Locale.ENGLISH))
                .collect(Collectors.toList()));

        clientResponse.setResponseTypes(
            Arrays.stream(OAuth20ResponseTypes.values())
                .map(type -> type.getType().toLowerCase(Locale.ENGLISH))
                .collect(Collectors.toList()));

        val validator = new SimpleUrlValidatorFactoryBean(false).getObject();
        val keystore = SpringExpressionLanguageValueResolver.getInstance().resolve(registeredService.getJwks());
        FunctionUtils.doUnchecked(param -> {
            if (Objects.requireNonNull(validator).isValid(keystore)) {
                clientResponse.setJwksUri(keystore);
            } else if (ResourceUtils.doesResourceExist(keystore)) {
                val res = ResourceUtils.getResourceFrom(keystore);
                val jsonWebKeys = OidcJsonWebKeystoreGeneratorService.toJsonWebKeyStore(res);
                clientResponse.setJwks(jsonWebKeys.toJson());
            } else if (StringUtils.isNotBlank(keystore)) {
                val jwks = new JsonWebKeySet(keystore);
                clientResponse.setJwks(jwks.toJson());
            }
            clientResponse.setLogo(registeredService.getLogo());
            clientResponse.setPolicyUri(registeredService.getInformationUrl());
            clientResponse.setTermsOfUseUri(registeredService.getPrivacyUrl());
            clientResponse.setRedirectUris(CollectionUtils.wrapList(registeredService.getServiceId()));
            val clientConfigUri = getClientConfigurationUri(registeredService, serverPrefix);
            clientResponse.setRegistrationClientUri(clientConfigUri);
        });
        clientResponse.setClientSecretExpiresAt(registeredService.getClientSecretExpiration());
        val dynamicRegistrationPropName = RegisteredServiceProperty.RegisteredServiceProperties.OIDC_DYNAMIC_CLIENT_REGISTRATION.getPropertyName();
        if (registeredService.getProperties().containsKey(dynamicRegistrationPropName)) {
            val dt = registeredService.getProperties()
                .get(RegisteredServiceProperties.OIDC_DYNAMIC_CLIENT_REGISTRATION_DATE.getPropertyName())
                .getValue(String.class);
            clientResponse.setClientIdIssuedAt(DateTimeUtils.localDateTimeOf(dt).toEpochSecond(ZoneOffset.UTC));
        }
        return clientResponse;
    }
Gets client registration response.

@param registeredService the registered service
@param serverPrefix      the server prefix
@return the client registration response
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/web/controllers/dynareg/OidcClientRegistrationUtils.java