If you pass in temporary = false in the json rep, then it won't set up the required action.

On 3/4/2016 9:22 PM, Chris Hairfield wrote:

I've been encountering the same issue with 1.4.0 and 1.6.1 and assume it's by design. I believe I've come across past threads confirming this.

My solution is to first create the user, then hit the reset password API, and, as a final and optional step, update the user with an empty requiredActions array to clear the Update Password action inherent in the reset password flow.

Hopefully someone that is more sure can step in to confirm.


On Fri, Mar 4, 2016, 11:38 AM Thiago Leonardo <thiagoleocosta@gmail.com> wrote:
Hi,

I'am trying create a new user in admin-client, but the credentials are not saved.
The new user is saved normaly. Can you help me ?

My code is:

Keycloak kc = KeycloakBuilder.builder()
.realm("Realm")
.username(username)
.password(password)
.clientId("admin-cli")
.resteasyClient( new ResteasyClientBuilder().connectionPoolSize(10).build() )
.build();

UserRepresentation newUser = new UserRepresentation();
newUser.setUsername(user.getEmail());
newUser.setFirstName(user.getName());
newUser.setEmail(usuario.getEmail());
newUser.setEnabled(true);

CredentialRepresentation credential = new CredentialRepresentation();
credential.setType(CredentialRepresentation.PASSWORD);
credential.setValue(user.getEmail());
credential.setTemporary(true);

newUser.setCredentials(Arrays.asList(credential));
kc.realm("Realm").users().create(newUser);


Regards,

Thiago
_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user


_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com