<div dir="ltr"><div>Hello I hope you can help.</div><div>When I want to create my user I do follows</div><div><br></div><div>Keycloak keycloak = Keycloak.getInstance (getURL (), &quot;MyRealm&quot;, &quot;myUser&quot;, &quot;myPassword&quot; clientID);</div><div>UserRepresentation userRep = new UserRepresentation ();</div><div>userRep.setUsername (&quot;testUser&quot;);</div><div>CredentialRepresentation CredentialRepresentation credentials = new ();</div><div>      credentials.setType (&quot;password&quot;);</div><div>      credentials.setValue (&quot;t&quot;);</div><div>      List &lt;CredentialRepresentation&gt; list = new ArrayList ();</div><div>      </div><div>      list.add (credentials);</div><div>      </div><div>      userRep.setCredentials (list);</div><div>        userRep.setEnabled (true);</div><div>        userRep.setEmail (&quot;<a href="mailto:myMail@outlook.com">myMail@outlook.com</a>&quot;);</div><div>        userRep.setEmailVerified (false);</div><div>        userRep.setFirstName (&quot;Javier&quot;);</div><div>        userRep.setLastName (&quot;Javi&quot;);</div><div>        </div><div>        Map map = new HashMap ();</div><div>        userRep.setAttributes (map);</div><div>        </div><div>        UsersResource users = keycloak.realm (&quot;MyRealm&quot;) users ().;</div><div>        </div><div>        Response response = users.create (userRep);</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><pre class="" id="tw-target-text" dir="ltr" style="font-family:inherit;border:none;padding:0px 0.14em 0px 0px;margin-top:0px;margin-bottom:0px;overflow:hidden;width:237.5px;white-space:pre-wrap;word-wrap:break-word;color:rgb(33,33,33);height:72px;font-weight:lighter!important;font-size:29px!important;line-height:36px!important"><span lang="en">first responds with code 200</span></pre></div><div><br></div><div><br></div><div><div><br></div><div>- 18:14:09 DEBUG org.apache.http.headers:273</div><div>&gt;&gt; POST /auth/realms/prevvy/protocol/openid-connect/token HTTP/1.1</div><div><br></div></div><div><div>- 18:14:09 DEBUG org.apache.http.impl.conn.DefaultClientConnection:254</div><div>Receiving response: HTTP/1.1 200 OK</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>but at the end responds with a 500 error and I don&#39;t know why :(:<br><br><div><br></div><div>- 18:14:10 DEBUG org.apache.http.wire:63</div><div>&gt;&gt; &quot;Host: develop.prevvy.co:9095[\r][\n]&quot;</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.wire:63</div><div>&gt;&gt; &quot;Connection: Keep-Alive[\r][\n]&quot;</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.wire:63</div><div>&gt;&gt; &quot;[\r][\n]&quot;</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.headers:273</div><div>&gt;&gt; POST /auth/admin/realms/prevvy/users HTTP/1.1</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.headers:276</div><div>&gt;&gt; Accept-Encoding: gzip, deflate</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.headers:276</div><div>&gt;&gt; Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI3ODgzZmE5ZS1iYzkyLTQzNDQtOWY3Ni02NTdiYWI4YjAzNzkiLCJleHAiOjE0MzY0OTEyMzYsIm5iZiI6MCwiaWF0IjoxNDM2NDkwOTM2LCJpc3MiOiJodHRwOi8vZGV2ZWxvcC5wcmV2dnkuY286OTA5NS9hdXRoL3JlYWxtcy9wcmV2dnkiLCJhdWQiOiJldmVudGhhbmRsZXItY2xpZW50Iiwic3ViIjoiYmIyMDQyZDktNjhlMS00MjQ5LWE5YWQtZTMzZjFkMTA3MGQ4IiwiYXpwIjoiZXZlbnRoYW5kbGVyLWNsaWVudCIsInNlc3Npb25fc3RhdGUiOiI0MzZjMTI2Ny1mNzA5LTQwNTEtOTk0YS03OWYyNjExZjM2Y2EiLCJjbGllbnRfc2Vzc2lvbiI6IjkxOGI2NWQ4LTY1YTUtNDljNi04M2JiLWQzOTg4ZGU0ODVlMCIsImFsbG93ZWQtb3JpZ2lucyI6W10sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJtYW5hZ2UtdXNlcnMiXX0sInJlc291cmNlX2FjY2VzcyI6e319.hAfHcOZZJwYBBoTRhlqzPfraesg7n9Gp0IHFQvmLYK-wYQBcFb7XAkAdGNWujW4kh5e7EJmyIggLWn0KnaPq2Qf2f57x34A3wjSklxdlIskUjLRZMVjUmUz65ayCPaFh33rxQIv6mhtST6CPdowZdsRyGfmcE9kKhknU8jjY2tY</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.headers:276</div><div>&gt;&gt; Content-Type: application/json</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.headers:276</div><div>&gt;&gt; Content-Length: 498</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.headers:276</div><div>&gt;&gt; Host: <a href="http://develop.prevvy.co:9095">develop.prevvy.co:9095</a></div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.headers:276</div><div>&gt;&gt; Connection: Keep-Alive</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.wire:77</div><div>&gt;&gt; &quot;{&quot;self&quot;:null,&quot;id&quot;:null,&quot;username&quot;:&quot;testttt&quot;,&quot;enabled&quot;:true,&quot;totp&quot;:false,&quot;emailVerified&quot;:false,&quot;firstName&quot;:&quot;Javier&quot;,&quot;lastName&quot;:&quot;Coria&quot;,&quot;email&quot;:&quot;<a href="mailto:jcoria@healthcentrix.com">jcoria@healthcentrix.com</a>&quot;,&quot;federationLink&quot;:null,&quot;attributes&quot;:{},&quot;credentials&quot;:[{&quot;type&quot;:&quot;password&quot;,&quot;device&quot;:null,&quot;value&quot;:&quot;t&quot;,&quot;hashedSaltedValue&quot;:null,&quot;salt&quot;:null,&quot;hashIterations&quot;:null,&quot;temporary&quot;:false}],&quot;requiredActions&quot;:null,&quot;federatedIdentities&quot;:null,&quot;realmRoles&quot;:null,&quot;clientRoles&quot;:null,&quot;clientConsents&quot;:null,&quot;applicationRoles&quot;:null,&quot;socialLinks&quot;:null}&quot;</div><div><br></div><div>- 18:14:10 DEBUG org.apache.http.wire:63</div><div>&lt;&lt; &quot;HTTP/1.1 500 Internal Server Error[\r][\n]&quot;</div></div><div><br></div><div><br></div><div><br></div><div>Thank you!!</div></div>