[keycloak-user] Admin REST API - create new user problem

Marko Radinovic markoradinovic79 at gmail.com
Wed Sep 24 10:19:11 EDT 2014


Hi,
I'm trying to make REST call to create new user account.

HttpPost post = new HttpPost(KeycloakUriBuilder
.fromUri(getBaseUrl(request) + "/auth")
.path("/admin/realms/{realm-name}/users")
.build("EHR Cloud"));

UserRepresentation userRepresentation = new UserRepresentation();
userRepresentation.setUsername("radinovic.marko");
userRepresentation.setEmail("markoradinovic79 at gmail.com");
userRepresentation.setEnabled(true);
userRepresentation.credential(CredentialRepresentation.PASSWORD, "marko");
userRepresentation.attribute("institutionId", "4");
userRepresentation.attribute("institution", "ZipSoft");
userRepresentation.setRealmRoles(Arrays.asList(new String[] {"ehr
-user-doctor"}));

After executing post, user is created, but user credentials and realm roles
are not saved.

Also, I try to update user, but still there is no credentials and realm
roles.

 HttpPost post = new HttpPost(KeycloakUriBuilder
.fromUri(getBaseUrl(request) + "/auth")
.path("/admin/realms/{realm-name}/users")
.build("EHR Cloud"));

I check in database, and there is no credentials and roles.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20140924/c328b2a7/attachment.html 


More information about the keycloak-user mailing list