From 2ad157005906b5a4ebeef08faae3e11195f5ca2e Mon Sep 17 00:00:00 2001 From: cat-bro Date: Thu, 11 Sep 2025 14:58:32 +1000 Subject: [PATCH] Make check for existing user in custos_authnz.py case insensitive --- lib/galaxy/authnz/custos_authnz.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/authnz/custos_authnz.py b/lib/galaxy/authnz/custos_authnz.py index efa0e10ecfa..e94ecb34728 100644 --- a/lib/galaxy/authnz/custos_authnz.py +++ b/lib/galaxy/authnz/custos_authnz.py @@ -18,6 +18,7 @@ from urllib.parse import quote import jwt from oauthlib.common import generate_nonce from requests_oauthlib import OAuth2Session +from sqlalchemy import func from galaxy import ( exceptions, @@ -246,7 +247,7 @@ class OIDCAuthnzBase(IdentityProvider): custos_authnz_token = self._get_custos_authnz_token(trans.sa_session, user_id, self.config.provider) if custos_authnz_token is None: user = trans.user - existing_user = trans.sa_session.query(User).filter_by(email=email).first() + existing_user = trans.sa_session.query(User).filter(func.lower(User.email) == email.lower()).first() if not user: if existing_user: if trans.app.config.fixed_delegated_auth: