back to black
2 files changed, 10 insertions, 3 deletions
diff --git a/synapse/config/saml2_config.py b/synapse/config/saml2_config.py
index afaa518ba5..a3e0a39259 100644
--- a/synapse/config/saml2_config.py
+++ b/synapse/config/saml2_config.py
@@ -48,8 +48,12 @@ class SAML2Config(Config):
saml2_config.get("saml_session_lifetime", "5m")
)
- self.saml2_username_attestation = saml2_config.get("username_attestation", "uid")
- self.saml2_displayname_attestation = saml2_config.get("displayname_attestation", "displayName")
+ self.saml2_username_attestation = saml2_config.get(
+ "username_attestation", "uid"
+ )
+ self.saml2_displayname_attestation = saml2_config.get(
+ "displayname_attestation", "displayName"
+ )
def _default_saml_config_dict(self):
import saml2
diff --git a/synapse/handlers/saml_handler.py b/synapse/handlers/saml_handler.py
index b81ac75281..f0f515e142 100644
--- a/synapse/handlers/saml_handler.py
+++ b/synapse/handlers/saml_handler.py
@@ -94,7 +94,10 @@ class SamlHandler:
raise SynapseError(400, "SAML2 response was not signed")
if self.saml2_username_attestation not in saml2_auth.ava:
- logger.warning("SAML2 response lacks a '%s' attestation", self.saml2_username_attestation)
+ logger.warning(
+ "SAML2 response lacks a '%s' attestation",
+ self.saml2_username_attestation,
+ )
raise SynapseError(400, "username attestation not in SAML2 response")
self._outstanding_requests_dict.pop(saml2_auth.in_response_to, None)
|