<div dir="ltr"><div>Am actually looking for an example like the AdminClient.</div><div><br></div><div>Once you create your post like this :</div><div><font><br></font></div><div><font>HttpPost </font><font color="#6a3e3e"><font color="#6a3e3e">post</font></font><font> = </font><b><font color="#7f0055"><font color="#7f0055">new</font></font></b><font> HttpPost(KeycloakUriBuilder.<i>fromUri</i>(<i>getBaseUrl</i>() + </font><font color="#2a00ff"><font color="#2a00ff">"/auth"</font></font><font>).path(ServiceUrlConstants.</font><b><i><font color="#0000c0"><font color="#0000c0">REALM_INFO_PATH</font></font></i></b><font>).build(</font><i><font color="#0000c0"><font color="#0000c0">realmName</font></font></i><font>));</font></div><div><font>
</font><p align="LEFT"><font> List <NameValuePair> </font><font color="#6a3e3e"><font color="#6a3e3e">formparams</font></font><font> = </font><b><font color="#7f0055"><font color="#7f0055">new</font></font></b><font> ArrayList <NameValuePair>();</font></p><font>
</font><p align="LEFT"><font> </font><font color="#6a3e3e"><font color="#6a3e3e">formparams</font></font><font>.add(</font><b><font color="#7f0055"><font color="#7f0055">new</font></font></b><font> BasicNameValuePair(</font><font color="#2a00ff"><font color="#2a00ff">"username"</font></font><font>, </font><i><font color="#0000c0"><font color="#0000c0">username</font></font></i><font>));</font></p><font>
</font><p align="LEFT"><font> </font><font color="#6a3e3e"><font color="#6a3e3e">formparams</font></font><font>.add(</font><b><font color="#7f0055"><font color="#7f0055">new</font></font></b><font> BasicNameValuePair(</font><font color="#2a00ff"><font color="#2a00ff">"password"</font></font><font>, </font><i><font color="#0000c0"><font color="#0000c0">password</font></font></i><font>));</font></p><font>
</font><p align="LEFT"><font> </font><font color="#6a3e3e"><font color="#6a3e3e">formparams</font></font><font>.add(</font><b><font color="#7f0055"><font color="#7f0055">new</font></font></b><font> BasicNameValuePair(OAuth2Constants.</font><b><i><font color="#0000c0"><font color="#0000c0">CLIENT_ID</font></font></i></b><font>, </font><i><font color="#0000c0"><font color="#0000c0">clientIdOrApplicationName</font></font></i><font>));</font></p><font>
</font><p align="LEFT"><font> UrlEncodedFormEntity </font><font color="#6a3e3e"><font color="#6a3e3e">form</font></font><font> = </font><b><font color="#7f0055"><font color="#7f0055">new</font></font></b><font> UrlEncodedFormEntity(</font><font color="#6a3e3e"><font color="#6a3e3e">formparams</font></font><font>, </font><font color="#2a00ff"><font color="#2a00ff">"UTF-8"</font></font><font>);</font></p><font>
</font><p><font> </font><font color="#6a3e3e"><font color="#6a3e3e">post</font></font><font>.setEntity(</font><font color="#6a3e3e"><font color="#6a3e3e">form</font></font><font>);</font></p>How do you send your realm representation ?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 30, 2014 at 12:00 PM, Stian Thorgersen <span dir="ltr"><<a href="mailto:stian@redhat.com" target="_blank">stian@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">If you're doing it from Java the admin client makes this very simple:<br>
<br>
<a href="https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/RealmTest.java" target="_blank">https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/RealmTest.java</a><br>
<br>
otherwise look at the rest docs:<br>
<br>
<a href="http://docs.jboss.org/keycloak/docs/1.0.1.Final/rest-api/overview-index.html" target="_blank">http://docs.jboss.org/keycloak/docs/1.0.1.Final/rest-api/overview-index.html</a><br>
<div><div class="h5"><br>
----- Original Message -----<br>
> From: "Alexander Chriztopher" <<a href="mailto:alexander.chriztopher@gmail.com">alexander.chriztopher@gmail.com</a>><br>
> To: <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> Sent: Tuesday, 30 September, 2014 11:55:59 AM<br>
> Subject: [keycloak-user] Realm update through REST API<br>
><br>
> Hi guys,<br>
><br>
> Just wondering wether you have an example to do any kind of update on a realm<br>
> through REST.<br>
><br>
> Many thanks for any help.<br>
><br>
> Regards.<br>
><br>
</div></div>> _______________________________________________<br>
> keycloak-user mailing list<br>
> <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
</blockquote></div><br></div></div>