From 6354a27126ab1570090a1c3b974480abcf15fdf5 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 20 Sep 2019 11:14:06 +0100 Subject: [PATCH] truncate displayname at @, too --- synapse/handlers/saml_handler.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/synapse/handlers/saml_handler.py b/synapse/handlers/saml_handler.py index cc9e6b9bd0..7cca1396a4 100644 --- a/synapse/handlers/saml_handler.py +++ b/synapse/handlers/saml_handler.py @@ -134,6 +134,12 @@ class SamlHandler: displayName = saml2_auth.ava.get("displayName", [None])[0] + # mozilla-specific hack: truncate at @ + if displayName: + pos = displayName.find("@") + if pos >= 0: + displayName = displayName[:pos] + with (await self._mapping_lock.queue(self._auth_provider_id)): # first of all, check if we already have a mapping for this user logger.info(