python-keycloak
python-keycloak copied to clipboard
Issue with "id:" in search parameter
Hi.
I'm seeing an issue when calling get_users with a search parameter that includes a colon. e.g.:
k.get_users({"search":"id:a4af3986-ff21-4978-b59d-a05ce4d58b14"})
According to the Java docs, this should be valid however it just hangs when I make the call. Accessing the url directly works fine. e.g. http://localhost:8080/auth/admin/realms/my-realm/users/?search=id:a4af3986-ff21-4978-b59d-a05ce4d58b14
The relevant java doc is here : https://www.keycloak.org/docs-api/7.0/javadocs/org/keycloak/admin/client/resource/UsersResource.html#search-java.lang.String-java.lang.Integer-java.lang.Integer-
I'm using python-keycloak==0.19.0 and Python==3.6.8
Keycloak API says that search is "A String contained in username, first or last name, or email".
I guess that the search for id is directly using the endpoint to GET {realm}/users/{id} and not doing a search, thus you can do that similarly and just use keycloak_admin.get_user(id)