<div dir="ltr"><div class="gmail_default" style=""><div class="gmail_default" style=""><font face="verdana, sans-serif">Hi,</font></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><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" style=""><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" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="verdana, sans-serif">My code is:</font></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><div class="gmail_default">Keycloak kc = KeycloakBuilder.builder()</div><div class="gmail_default"><span class="" style="white-space:pre">        </span>.serverUrl(&quot;<a href="http://localhost:8080/auth">http://localhost:8080/auth</a>&quot;)</div><div class="gmail_default"><span class="" style="white-space:pre">        </span>.realm(&quot;Realm&quot;)</div><div class="gmail_default"><span class="" style="white-space:pre">        </span>.username(username)</div><div class="gmail_default"><span class="" style="white-space:pre">        </span>.password(password)</div><div class="gmail_default"><span class="" style="white-space:pre">        </span>.clientId(&quot;admin-cli&quot;)</div><div class="gmail_default"><span class="" style="white-space:pre">        </span>.resteasyClient( new ResteasyClientBuilder().connectionPoolSize(10).build() )</div><div class="gmail_default"><span class="" style="white-space:pre">        </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" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="verdana, sans-serif">Regards,</font></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="verdana, sans-serif">Thiago</font></div></div>
</div>