Mickael Jeanroy
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/keycloak/keycloak_admin.py
|
|
@ -850,8 +850,8 @@ class KeycloakAdmin: |
|
|
|
:rtype: str |
|
|
|
""" |
|
|
|
lower_user_name = username.lower() |
|
|
|
users = self.get_users(query={"search": lower_user_name}) |
|
|
|
return next((user["id"] for user in users if user["username"] == lower_user_name), None) |
|
|
|
users = self.get_users(query={"username": lower_user_name, "max": 1, "exact": True}) |
|
|
|
return users[0]["id"] if len(users) == 1 else None |
|
|
|
|
|
|
|
def get_user(self, user_id): |
|
|
|
"""Get representation of the user. |
|
|
|