<div dir="ltr">We&#39;ll fix this in the future so you can do a single post with new user, including credentials and role mappings. For now you&#39;ll have to do the two separate requests though.</div><div class="gmail_extra"><br><div class="gmail_quote">On 5 March 2016 at 13:18, Bill Burke <span dir="ltr">&lt;<a href="mailto:bburke@redhat.com" target="_blank">bburke@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    If you pass in temporary = false in the json rep, then it won&#39;t set
    up the required action.<div><div class="h5"><br>
    <br>
    <div>On 3/4/2016 9:22 PM, Chris Hairfield
      wrote:<br>
    </div>
    <blockquote type="cite">
      <p dir="ltr">I&#39;ve been encountering the same issue with 1.4.0 and
        1.6.1 and assume it&#39;s by design. I believe I&#39;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
          &lt;<a href="mailto:thiagoleocosta@gmail.com" target="_blank">thiagoleocosta@gmail.com</a>&gt;
          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&#39;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(&quot;<a href="http://localhost:8080/auth" target="_blank"></a><a href="http://localhost:8080/auth" target="_blank">http://localhost:8080/auth</a>&quot;)</div>
                  <div class="gmail_default"><span style="white-space:pre-wrap">        </span>.realm(&quot;Realm&quot;)</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(&quot;admin-cli&quot;)</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(&quot;Realm&quot;).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>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
keycloak-user mailing list
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
    </div></div><span class="HOEnZb"><font color="#888888"><pre cols="72">-- 
Bill Burke
JBoss, a division of Red Hat
<a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a></pre>
  </font></span></div>

<br>_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">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><br></blockquote></div><br></div>