[keycloak-user] Impossible to create/assign a user to a group

_ JnMlMe _ jnmlme at outlook.com
Thu Sep 14 05:34:37 EDT 2017


When using admin API (throw curl) to initiliaze via puppet the settings of my realms, I didn't manage to both create a user and assigned him to a group. The expected user is indeed created but not joined to the expected group.
The API produces no errors in logs. It seems that the groups attribute is just ignore.

Tests done on a 3.3.0.CR2 vanilla.

$ curl -X POST -uadmin:admin http://localhost:8080/auth/admin/realms/master/groups -H "Content-Type: application/json" -H "Authorization: bearer $(curl -s -d "client_id=admin-cli" -d "username=admin" -d "password=admin" -d "grant_type=password" "http://localhost:8080/auth/realms/master/protocol/openid-connect/token" | sed 's/.*access_token":"//g' | sed 's/".*//g')" -d at group.json

$ curl -X POST -uadmin:admin http://localhost:8080/auth/admin/realms/master/users -H "Content-Type: application/json" -H "Authorization: bearer $(curl -s -d "client_id=admin-cli" -d "username=admin" -d "password=admin" -d "grant_type=password" "http://localhost:8080/auth/realms/master/protocol/openid-connect/token" | sed 's/.*access_token":"//g' | sed 's/".*//g')" -d at user.json

Thks



More information about the keycloak-user mailing list