[keycloak-user] Unable to create user with roles using Rest API

Bill Burke bburke at redhat.com
Tue May 16 15:08:40 EDT 2017


you have to call a separate REST API after you create the user to add 
roles/groups.


On 5/16/17 1:33 PM, Hylton Peimer wrote:
> I have created a new Realm and added a role: "DOCTORS".
>
> POST to /admin/realms/{realm}/users
>
> With the following JSON:
>   {"realmRoles":["DOCTORS"],"enabled":"true","username":"drhp"}
>
> This invocation creates the user, but the "DOCTORS" role is not assigned.
>
> The rest call is using a bearer token obtained from an administrative user
> in the master realm.
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user



More information about the keycloak-user mailing list