diff --git a/lib/galaxy/authnz/custos_authnz.py b/lib/galaxy/authnz/custos_authnz.py index c0047191b12..3f9ed0bcc0f 100644 --- a/lib/galaxy/authnz/custos_authnz.py +++ b/lib/galaxy/authnz/custos_authnz.py @@ -108,7 +108,7 @@ class CustosAuthnz(IdentityProvider): len(trans.app.auth_manager.authenticators) == 0): user = existing_user else: - message = 'There already exists a user this email. To associate this external login, you must first be logged in as that existing account.' + message = "There already exists a user with email %s. To associate this external login, you must first be logged in as that existing account." % email log.exception(message) raise exceptions.AuthenticationFailed(message) else: diff --git a/lib/galaxy/authnz/managers.py b/lib/galaxy/authnz/managers.py index 897eb9e923e..8cc8104eb7c 100644 --- a/lib/galaxy/authnz/managers.py +++ b/lib/galaxy/authnz/managers.py @@ -297,9 +297,8 @@ class AuthnzManager: if success is False: return False, message, (None, None) return success, message, backend.callback(state_token, authz_code, trans, login_redirect_url) - except exceptions.AuthenticationFailed as e: - log.exception(e.message) - raise exceptions.AuthenticationFailed(e.message) + except exceptions.AuthenticationFailed: + raise except Exception as e: msg = 'The following error occurred when handling callback from `{}` identity provider: ' \ '{}'.format(provider, str(e)) diff --git a/lib/galaxy/webapps/galaxy/controllers/authnz.py b/lib/galaxy/webapps/galaxy/controllers/authnz.py index 3d24f5a26ae..4e377e3b9c4 100644 --- a/lib/galaxy/webapps/galaxy/controllers/authnz.py +++ b/lib/galaxy/webapps/galaxy/controllers/authnz.py @@ -82,8 +82,8 @@ class OIDC(JSAppLauncher): trans, login_redirect_url=url_for('/'), idphint=idphint) - except exceptions.AuthenticationFailed as e: - return trans.response.send_redirect(trans.request.base + url_for('/') + 'root/login?message=' + (e.message or "Duplicate Email")) + except exceptions.AuthenticationFailed: + raise if success is False: return trans.show_error_message(message) user = user if user is not None else trans.user