diff --git a/src/saml2/response.py b/src/saml2/response.py index 26963a04e..a9978461a 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -408,12 +408,13 @@ def _verify(self): else: raise RequestVersionTooHigh() - if self.asynchop: - if ( - self.response.destination - and self.response.destination not in self.return_addrs - ): - logger.error("%s not in %s", self.response.destination, self.return_addrs) + destination = self.response.destination + if self.asynchop and destination: + # Destination must be present + if destination not in self.return_addrs: + logger.error( + f"{destination} not in {self.return_addrs}" + ) return None valid = self.issue_instant_ok() and self.status_ok() @@ -1116,7 +1117,7 @@ def session_info(self): raise StatusInvalidAuthnResponseStatement( "The Authn Response Statement is not valid" ) - + def __str__(self): return self.xmlstr