I need to retrieve a user by his email. How can I achieve this?
Im using Python 3.10 with the library python-keycloak (https://pypi.org/project/python-keycloak/) but there isn't a method to achieve this.
Someone know how to do this? Really thanks
CodePudding user response:
Python keycloak is just a wrapper that passes the parameters to keycloak rest endpoint for users. In the REST api docs for users resource you can see that the query param email
can be passed.
Your code should look like this:
users = keycloak_admin.get_users({"email":"[email protected]"})