<div dir="ltr">Hello and thank you both for your answers.<div><br></div><div>Very complete. Both of them worked.</div><div><br></div><div>Thank you again,</div><div>Horia</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 4, 2015 at 2:55 PM, Scott Rossillo <span dir="ltr"><<a href="mailto:srossillo@smartling.com" target="_blank">srossillo@smartling.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Keycloak keycloak = Keycloak.getInstance(…); // your args here</div><div>UserRepresentation user = new UserRepresentation();</div><div><br></div><div>// call user setters</div><div><br></div><div>try {</div><div><span style="white-space:pre-wrap">        </span>keycloak.realm(“realm-name").users().create(user);</div><div>} finally {</div><div><span style="white-space:pre-wrap">        </span>keycloak.close();</div><div>}</div><div><br></div><br><div><blockquote type="cite"><div><div class="h5"><div>On Jun 4, 2015, at 6:14 AM, Horia Mocioi <<a href="mailto:a.mocioi@gmail.com" target="_blank">a.mocioi@gmail.com</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr">Hello,<div><br></div><div>I would like to create a user via Admin REST API using HttpPost. Unfortunately, I was not able to find any example on how to create a user or role.</div><div><br></div><div>I successfully managed to list roles and user using the example from admin-access-api, but now I would like to create a new user.</div><div><br></div><div>Can anyone provide an example using HttpPost on how to create a new user?</div><div><br></div><div>Thank you,</div><div>Horia<br clear="all"><div><br></div>-- <br><div><a href="http://bookreader.ro/" target="_blank"><img></a></div>
</div></div></div></div><span class="">
_______________________________________________<br>keycloak-dev mailing list<br><a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></span></div></blockquote></div><br></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><a href="http://bookreader.ro" target="_blank"><img src="http://bookreader.ro/wpbook/wp-content/uploads/2012/02/BookReader_logo.png"></a></div>
</div>