diff options
author | Maxime Besson <maxime.besson@worteks.com> | 2020-09-28 18:14:28 +0200 |
---|---|---|
committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-10-27 22:07:54 +0200 |
commit | 0edfb57b8863d39a776b9a1c0e288c8f95d845bb (patch) | |
tree | 48329014ffaf7fec1e952f7057d8a88889f929dd /src/saml2/entity.py | |
parent | ca60cd969a263570c6fe0b1247e319dcba63f813 (diff) | |
download | pysaml2-0edfb57b8863d39a776b9a1c0e288c8f95d845bb.tar.gz |
Fixes #720: honor ResponseLocation in metadata when building logout responses
Diffstat (limited to 'src/saml2/entity.py')
-rw-r--r-- | src/saml2/entity.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/saml2/entity.py b/src/saml2/entity.py index 9f564ffa..fad9326a 100644 --- a/src/saml2/entity.py +++ b/src/saml2/entity.py @@ -53,7 +53,7 @@ from saml2.samlp import ArtifactResponse from saml2.samlp import Artifact from saml2.samlp import LogoutRequest from saml2.samlp import AttributeQuery -from saml2.mdstore import destinations +from saml2.mdstore import destinations, response_destinations from saml2 import BINDING_HTTP_POST from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_SOAP @@ -250,7 +250,7 @@ class Entity(HTTPBase): return info def pick_binding(self, service, bindings=None, descr_type="", request=None, - entity_id=""): + entity_id="", response=False): if request and not entity_id: entity_id = request.issuer.text.strip() @@ -284,7 +284,10 @@ class Entity(HTTPBase): if srv["index"] == _index: return binding, srv["location"] else: - return binding, destinations(srvs)[0] + if response: + return binding, response_destinations(srvs)[0] + else: + return binding, destinations(srvs)[0] except UnsupportedBinding: pass @@ -351,7 +354,8 @@ class Entity(HTTPBase): binding, destination = self.pick_binding(rsrv, bindings, descr_type=descr_type, - request=message) + request=message, + response=True) info["binding"] = binding info["destination"] = destination |