[keycloak-user] How to get user id programmatically

Marko Strukelj mstrukel at redhat.com
Thu May 26 06:24:24 EDT 2016


There is no documentation for admin-client API at the moment. Admin REST
endpoints are documented here:
http://keycloak.github.io/docs/rest-api/index.html#_get_users

But as you can see, that doc is not great. It's not explained there that
for page offset you can pass -1 to mean the same as null or 0.


On Thu, May 26, 2016 at 12:13 PM, Haim Vana <haimv at perfectomobile.com>
wrote:

> Great – that was exactly what I was missing.
>
>
>
> BTW where can I find its documentation ?
>
>
>
>
>
> *From:* Marko Strukelj [mailto:mstrukel at redhat.com]
> *Sent:* Thursday, May 26, 2016 1:06 PM
> *To:* Haim Vana <haimv at perfectomobile.com>
> *Cc:* keycloak-user at lists.jboss.org
> *Subject:* Re: [keycloak-user] How to get user id programmatically
>
>
>
> Pagination offset starts from 0, not 1. You can as well put null, null for
> offset and max results, or -1, -1.
>
>
>
> On Thu, May 26, 2016 at 10:56 AM, Haim Vana <haimv at perfectomobile.com>
> wrote:
>
> Hi,
>
>
>
> How can I get the user id programmatically ? I am trying to user the
> search API as below, however I am not getting any results although the user
> exist within the realm.
>
>
>
> keyCloakClient.realms().realm(realmName).users().search(user.getUserName(),
> user.getFirstName(), user.getLastName(), user.getEmail(), 1*/*pagination
> offset*/*, 1*/*max results*/*);
>
>
>
>
>
> Any advice will be appreciated.
>
>
>
>
>
> Thanks,
>
> Haim.
>
>
>
> 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.
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
>
> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160526/48d0ba81/attachment.html 


More information about the keycloak-user mailing list