[keycloak-user] keycloak-admin-client and realm initialization

Okie Oth okie.othsam at gmail.com
Tue May 31 06:30:50 EDT 2016


Hello,
I'm a keycloak newbie and try to write a tool that initialize my 
keycloak installation. Some parts work fine but I can't do deeper 
initializations. For instance I can create a new user group but if I 
want to assign some realm roles for the new created group nothing happens.

I checked the results with the normal Keycloak webfrontend.

Here is my sample code:
...
GroupRepresentation gr = new GroupRepresentation();
gr.setName("myGroup");
List<String> realmRoleList=new ArrayList();
realmRoleList.add("test");
gr.setRealmRoles(realmRoleList);
realmResource.groups().add(gr);
...
// now the group 'myGroup' exists but no roles are assigned.

Any advice or help is welcome

Kind regards
Eiko




More information about the keycloak-user mailing list