From 5e8264f9ff4b388bbd2ab990bd4074b638261d32 Mon Sep 17 00:00:00 2001 From: selten Date: Thu, 28 Jan 2021 20:13:56 +0100 Subject: [PATCH] Make OIDC email matching case-insensitive OIDC email matching is currently case-sensitive, in order to not create duplicate accounts when the internal Galaxy database and the OIDC provider do not agree on the case-sensitivity of emails, they should be validated without case-sensitivity. See https://github.com/galaxyproject/galaxy/issues/9981. --- lib/galaxy/model/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 71c762fdf1f..643aa8628c3 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -6136,7 +6136,7 @@ class UserAuthnzToken(UserMixin, RepresentById): @classmethod def get_users_by_email(cls, email): - return cls.user_query().filter_by(email=email) + return cls.user_query().filter(func.lower(User.table.c.email) == email.lower()) @classmethod def get_social_auth(cls, provider, uid):