<div dir="ltr">Hi,<div>I&#39;m trying to make REST call to create new user account.</div><div><br></div><div><div><span class="" id=":109.1" tabindex="-1" style="background:yellow">HttpPost</span> post = new <span class="" id=":109.2" tabindex="-1" style="background:yellow">HttpPost</span>(<span class="" id=":109.3" tabindex="-1" style="background:yellow">KeycloakUriBuilder</span></div><div><span class="" style="white-space:pre">                                        </span>.<span class="" id=":109.4" tabindex="-1" style="background:yellow">fromUri</span>(<span class="" id=":109.5" tabindex="-1" style="background:yellow">getBaseUrl</span>(request) + &quot;/<span class="" id=":109.6" tabindex="-1" style="background:yellow">auth</span>&quot;)</div><div><span class="" style="white-space:pre">                                        </span>.path(&quot;/admin/realms/{realm-name}/users&quot;)</div><div><span class="" style="white-space:pre">                                        </span>.build(&quot;<span class="" id=":109.7" tabindex="-1" style="background:yellow">EHR</span> Cloud&quot;));</div></div><div><br></div><div><div><span class="" id=":109.8" tabindex="-1" style="background:yellow">UserRepresentation</span> <span class="" id=":109.9" tabindex="-1" style="background:yellow">userRepresentation</span> = new <span class="" id=":109.10" tabindex="-1" style="background:yellow">UserRepresentation</span>();</div><div><span class="" id=":109.11" tabindex="-1" style="background:yellow">userRepresentation</span>.<span class="" id=":109.12" tabindex="-1" style="background:yellow">setUsername</span>(&quot;<span class="" id=":109.13" tabindex="-1" style="background:yellow">radinovic</span>.<span class="" id=":109.14" tabindex="-1" style="background:yellow">marko</span>&quot;);</div><div><span class="" id=":109.15" tabindex="-1" style="background:yellow">userRepresentation</span>.<span class="" id=":109.16" tabindex="-1" style="background:yellow">setEmail</span>(&quot;<a href="mailto:markoradinovic79@gmail.com">markoradinovic79@gmail.com</a>&quot;);</div><div><span class="" id=":109.17" tabindex="-1" style="background:yellow">userRepresentation</span>.<span class="" id=":109.18" tabindex="-1" style="background:yellow">setEnabled</span>(true);</div><div><span class="" id=":109.19" tabindex="-1" style="background:yellow">userRepresentation</span>.credential(<span class="" id=":109.20" tabindex="-1" style="background:yellow">CredentialRepresentation</span>.PASSWORD, &quot;<span class="" id=":109.21" tabindex="-1" style="background:yellow">marko</span>&quot;);</div><div><span class="" id=":109.22" tabindex="-1" style="background:yellow">userRepresentation</span>.attribute(&quot;<span class="" id=":109.23" tabindex="-1" style="background:yellow">institutionId</span>&quot;, &quot;4&quot;);</div><div><span class="" id=":109.24" tabindex="-1" style="background:yellow">userRepresentation</span>.attribute(&quot;institution&quot;, &quot;<span class="" id=":109.25" tabindex="-1" style="background:yellow">ZipSoft</span>&quot;);<span class="" style="white-space:pre">                        </span></div><div><span class="" id=":109.26" tabindex="-1" style="background:yellow">userRepresentation</span>.<span class="" id=":109.27" tabindex="-1" style="background:yellow">setRealmRoles</span>(Arrays.<span class="" id=":109.28" tabindex="-1" style="background:yellow">asList</span>(new String[] {&quot;<span class="" id=":109.29" tabindex="-1" style="background:yellow">ehr</span>-user-doctor&quot;}));</div></div><div><br></div><div>After executing post, user is created, but user credentials and realm roles are not saved.</div><div><br></div><div>Also, I try to update user, but still there is no credentials and realm roles.</div><div><br></div><div> HttpPost post = new HttpPost(KeycloakUriBuilder</div><div><span class="" style="white-space:pre">                                        </span>.fromUri(getBaseUrl(request) + &quot;/auth&quot;)</div><div><span class="" style="white-space:pre">                                        </span>.path(&quot;/admin/realms/{realm-name}/users&quot;)</div><div><span class="" style="white-space:pre">                                        </span>.build(&quot;EHR Cloud&quot;));</div><div><br></div><div>I check in database, and there is no credentials and roles.</div><div><br></div><div><br></div></div>