<div dir="ltr">Hello Haim,<div><br></div><div>I think the following does what you are look for.</div><div><br></div><div>int pageIndex = 0;</div><div>int pageSize = 1000;</div><div>String realmName = "master";</div><div><br></div><div>List<UserRepresentation> results = keycloak.realm(realmName).users().search(null, null, null, null, pageIndex * pageSize, pageSize)</div><div><br></div><div>where Keycloak is org.keycloak.admin.client.Keycloak.</div><div><br></div><div>Cheers,</div><div>Thomas</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-27 11:59 GMT+02:00 Haim Vana <span dir="ltr"><<a href="mailto:haimv@perfectomobile.com" target="_blank">haimv@perfectomobile.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is there a way to list all realm users programmatically via the API ? also is there a way to delete all of them ?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I think I should use the below, however what should I insert in the search method for getting all the users ?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="background:white"><b><i>keyCloakClient.realms().realm(realmName).users().search()<u></u><u></u></i></b></p>
<p class="MsoNormal" style="background:white"><span style="font-size:11.5pt;font-family:"Courier New";color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:11.5pt;font-family:"Courier New";color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:white">Thanks,<u></u><u></u></p>
<p class="MsoNormal" style="background:white">Haim.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
The information contained in this message is proprietary to the sender, protected from disclosure, and may be privileged. The information is intended to be conveyed only to the designated recipient(s) of the message. If the reader of this message is not the
intended recipient, you are hereby notified that any dissemination, use, distribution or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by replying to
the message and deleting it from your computer. Thank you.
</div>
<br>_______________________________________________<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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br></blockquote></div><br></div>