Search in sources :

Example 1 with ClientTemplateRepresentation

use of org.keycloak.representations.idm.ClientTemplateRepresentation in project keycloak by keycloak.

the class RepresentationToModel method convertDeprecatedClientTemplates.

private static void convertDeprecatedClientTemplates(RealmRepresentation realm) {
    if (realm.getClientTemplates() != null) {
        logger.warnf("Using deprecated 'clientTemplates' configuration in JSON representation for realm '%s'. It will be removed in future versions", realm.getRealm());
        List<ClientScopeRepresentation> clientScopes = new LinkedList<>();
        for (ClientTemplateRepresentation template : realm.getClientTemplates()) {
            ClientScopeRepresentation scopeRep = new ClientScopeRepresentation();
            scopeRep.setId(template.getId());
            scopeRep.setName(template.getName());
            scopeRep.setProtocol(template.getProtocol());
            scopeRep.setDescription(template.getDescription());
            scopeRep.setAttributes(template.getAttributes());
            scopeRep.setProtocolMappers(template.getProtocolMappers());
            clientScopes.add(scopeRep);
        }
        realm.setClientScopes(clientScopes);
    }
}
Also used : ClientTemplateRepresentation(org.keycloak.representations.idm.ClientTemplateRepresentation) ClientScopeRepresentation(org.keycloak.representations.idm.ClientScopeRepresentation) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 ClientScopeRepresentation (org.keycloak.representations.idm.ClientScopeRepresentation)1 ClientTemplateRepresentation (org.keycloak.representations.idm.ClientTemplateRepresentation)1