<p dir="ltr">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.</p>
<p dir="ltr">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.</p>
<p dir="ltr">Hopefully someone that is more sure can step in to confirm.</p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 4, 2016, 11:38 AM Thiago Leonardo <<a href="mailto:thiagoleocosta@gmail.com">thiagoleocosta@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default"><div class="gmail_default"><font face="verdana, sans-serif">Hi,</font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">I'am trying create a new user in admin-client, but the credentials are not saved.</font></div><div class="gmail_default"><font face="verdana, sans-serif">The new user is saved normaly. </font><span style="font-family:verdana,sans-serif">Can you help me ?</span></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">My code is:</font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif"><div class="gmail_default">Keycloak kc = KeycloakBuilder.builder()</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>.serverUrl("<a href="http://localhost:8080/auth" target="_blank">http://localhost:8080/auth</a>")</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>.realm("Realm")</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>.username(username)</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>.password(password)</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>.clientId("admin-cli")</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>.resteasyClient( new ResteasyClientBuilder().connectionPoolSize(10).build() )</div><div class="gmail_default"><span style="white-space:pre-wrap">        </span>.build();</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">UserRepresentation newUser = new UserRepresentation();</div><div class="gmail_default">newUser.setUsername(user.getEmail());</div><div class="gmail_default">newUser.setFirstName(user.getName());</div><div class="gmail_default">newUser.setEmail(usuario.getEmail());</div><div class="gmail_default">newUser.setEnabled(true);</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">CredentialRepresentation credential = new CredentialRepresentation();</div><div class="gmail_default">credential.setType(CredentialRepresentation.PASSWORD);</div><div class="gmail_default">credential.setValue(user.getEmail());</div><div class="gmail_default">credential.setTemporary(true);<br></div><div class="gmail_default"><br></div><div class="gmail_default">newUser.setCredentials(Arrays.asList(credential));<br></div></div><div class="gmail_default">kc.realm("Realm").users().create(newUser);<br></div></div></font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">Regards,</font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">Thiago</font></div></div>
</div>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></blockquote></div>