I am trying to update a user with an administrator role for an area using the admin console, but it does not work.
My code is:
UserResource use = userResources.get(search.get(0).getId()); use.resetPassword(credentials); user=use.toRepresentation(); List<String> roles=new ArrayList<String>(); roles.add("realm-admin"); Map<String,List<String>> m= new HashMap<String,List<String>>(); m.put("realm-management",roles); user.setClientRoles(m); use.update(user);
Any idea what I can do wrong?
source share