Browse Source

Merge pull request #187 from arata-honda/fix-get-user-id

BugFix get_user_id to non case-sensitive
pull/199/head
Marcos Pereira 4 years ago
committed by GitHub
parent
commit
4c717dbd77
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      keycloak/keycloak_admin.py

6
keycloak/keycloak_admin.py

@ -410,9 +410,9 @@ class KeycloakAdmin:
:return: user_id
"""
users = self.get_users(query={"search": username})
return next((user["id"] for user in users if user["username"] == username), None)
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)
def get_user(self, user_id):
"""

Loading…
Cancel
Save