<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Keycloak keycloak =&nbsp;Keycloak.getInstance(…); // your args here</div><div class="">UserRepresentation user =&nbsp;new&nbsp;UserRepresentation();</div><div class=""><br class=""></div><div class="">// call user setters</div><div class=""><br class=""></div><div class="">try {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>keycloak.realm(“realm-name").users().create(user);</div><div class="">} finally {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>keycloak.close();</div><div class="">}</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 4, 2015, at 6:14 AM, Horia Mocioi &lt;<a href="mailto:a.mocioi@gmail.com" class="">a.mocioi@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Can anyone provide an example using HttpPost on how to create a new user?</div><div class=""><br class=""></div><div class="">Thank you,</div><div class="">Horia<br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><a href="http://bookreader.ro/" target="_blank" class=""><img src="http://bookreader.ro/wpbook/wp-content/uploads/2012/02/BookReader_logo.png" class=""></a></div>
</div></div>
_______________________________________________<br class="">keycloak-dev mailing list<br class=""><a href="mailto:keycloak-dev@lists.jboss.org" class="">keycloak-dev@lists.jboss.org</a><br class="">https://lists.jboss.org/mailman/listinfo/keycloak-dev</div></blockquote></div><br class=""></body></html>