I am using the API to add a subgroup and encountering an issue where the created group is renamed to be the pathName and not the supplied name.
Here is my code:
//we use a top level group to represent our tenants
GroupRepresentation tenantGroup = getOrCreatTenantGroup(realm, clientName);
GroupRepresentation group = new GroupRepresentation();
//we pass a group name like “My group”
Response resp = realm.groups().group(tenantGroup.getId()).subGroup(group);
int code = resp.getStatus();
//created group will be “/tenantName/My group”
This is using “ancient” Keycloak 4.6 and keycloak-admin-client 4.0.0.