Hello,
I have an application with Spring-boot 2.7.x, Keycloak 20.0.5 (try with Keycloak 21 with the same issue)
I can create Realm, add roles, add group and users without probleme.
But:
- get an 404 error when adding group to an UserResource : userResource.joinGroup(group);
- get an 404 error when adding user to an GroupResource : realm.groups().group(group).members().add(userResource.toRepresentation());
- get an error 404 when associates role to a group
- get no error when adding a RoleRepresentation to UserResource, but without effect : userResource.roles().realmLevel().add(Collections.singletonList(realm.roles().get(role.name()).toRepresentation()));
I use this code to add a role to a group :
- RoleRepresentation role = REALM.roles().get(roleName).toRepresentation();
RoleScopeResource roleScope = REALM.groups().group(groupName).roles().realmLevel();
roleScope.add(List.of(role));
all user, user_id, role name, group name are correct and well created in the realm
Any idea ?
Thanks by advance