Only log if an existing localpart was found, extend logged info
parent
ee382025b0
commit
4c9ce096d9
|
@ -266,11 +266,6 @@ class SamlHandler(BaseHandler):
|
||||||
user_id = UserID(
|
user_id = UserID(
|
||||||
map_username_to_mxid_localpart(attrval), self.server_name
|
map_username_to_mxid_localpart(attrval), self.server_name
|
||||||
).to_string()
|
).to_string()
|
||||||
logger.info(
|
|
||||||
"Looking for existing account based on mapped %s %s",
|
|
||||||
self._grandfathered_mxid_source_attribute,
|
|
||||||
user_id,
|
|
||||||
)
|
|
||||||
|
|
||||||
users = await self.store.get_users_by_id_case_insensitive(user_id)
|
users = await self.store.get_users_by_id_case_insensitive(user_id)
|
||||||
if users:
|
if users:
|
||||||
|
@ -317,7 +312,7 @@ class SamlHandler(BaseHandler):
|
||||||
"Unable to generate a Matrix ID from the SAML response"
|
"Unable to generate a Matrix ID from the SAML response"
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info("Mapped SAML user to local part %s", localpart)
|
logger.debug("Mapped SAML user to local part %s", localpart)
|
||||||
registered_user_id = await self._registration_handler.register_user(
|
registered_user_id = await self._registration_handler.register_user(
|
||||||
localpart=localpart,
|
localpart=localpart,
|
||||||
default_display_name=displayname,
|
default_display_name=displayname,
|
||||||
|
|
|
@ -72,18 +72,18 @@ class SsoHandler(BaseHandler):
|
||||||
The mxid of a previously seen user.
|
The mxid of a previously seen user.
|
||||||
"""
|
"""
|
||||||
# Check if we already have a mapping for this user.
|
# Check if we already have a mapping for this user.
|
||||||
logger.info(
|
|
||||||
"Looking for existing mapping for user %s:%s",
|
|
||||||
auth_provider_id,
|
|
||||||
remote_user_id,
|
|
||||||
)
|
|
||||||
previously_registered_user_id = await self.store.get_user_by_external_id(
|
previously_registered_user_id = await self.store.get_user_by_external_id(
|
||||||
auth_provider_id, remote_user_id,
|
auth_provider_id, remote_user_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
# A match was found, return the user ID.
|
# A match was found, return the user ID.
|
||||||
if previously_registered_user_id is not None:
|
if previously_registered_user_id is not None:
|
||||||
logger.info("Found existing mapping %s", previously_registered_user_id)
|
logger.info(
|
||||||
|
"Found existing mapping for IdP '%s' and remote_user_id '%s': %s",
|
||||||
|
auth_provider_id,
|
||||||
|
remote_user_id,
|
||||||
|
previously_registered_user_id,
|
||||||
|
)
|
||||||
return previously_registered_user_id
|
return previously_registered_user_id
|
||||||
|
|
||||||
# No match.
|
# No match.
|
||||||
|
|
Loading…
Reference in New Issue