Browse Source

Fix get_user_id to non case-sensitive

master
arata-honda 4 years ago
parent
commit
c91df2b5c8
  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