Hello,
From the migrating doc, I think it was intended
(
https://www.keycloak.org/docs/latest/upgrading/index.html#client-template...).
I used a bit of code with keycloak admin client to set a client scope
to all client (except default) for a given realm:
"
Keycloak keycloak = Keycloak.getInstance("https://<keycloak>",
"master", "admin", "************************************",
"admin-cli");
List<String> defaultClients = Arrays.asList("account",
"broker", "admin-cli", "realm-management",
"security-admin-console");
List<String> defaultScope = Arrays.asList("profile",
"email");
List<ClientScopeRepresentation> defaultScopes =
keycloak.realm(realmName).clientScopes().findAll().stream()
.filter(c ->
defaultScope.contains(c.getName())).collect(Collectors.toList());
keycloak.realm(realmName).clients().findAll(true).forEach(client -> {
if (!defaultClients.contains(client.getClientId()) &&
client.getDefaultClientScopes().isEmpty()) {
client.setDefaultClientScopes(defaultScope);
defaultScopes.forEach(scope -> {
keycloak.realm(realmName).clients().get(client.getId()).addDefaultClientScope(scope.getId());
});
}
});
"
Le jeu. 2 août 2018 à 09:48, Eivind Larsen <eivind(a)jotta.no> a écrit :
Hi Keycloak users!
After upgrading from 3.4.3 to 4.x, client templates are converted to client
scopes. The conversion of the templates themselves look correct.
Many clients had a default template set. After upgrade the corresponding
default template is not included in the default scopes of the client.
Is this intended? Do we have to manually update each client with the
default scope?
Is there a way to add the default scopes using the API?
Best regards,
Eivind Larsen
_______________________________________________
keycloak-user mailing list
keycloak-user(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user