|
53 | 53 | from saml2.samlp import Artifact
|
54 | 54 | from saml2.samlp import LogoutRequest
|
55 | 55 | from saml2.samlp import AttributeQuery
|
56 |
| -from saml2.mdstore import destinations |
| 56 | +from saml2.mdstore import destinations, response_destinations |
57 | 57 | from saml2 import BINDING_HTTP_POST
|
58 | 58 | from saml2 import BINDING_HTTP_REDIRECT
|
59 | 59 | from saml2 import BINDING_SOAP
|
@@ -250,7 +250,7 @@ def apply_binding(self, binding, msg_str, destination="", relay_state="",
|
250 | 250 | return info
|
251 | 251 |
|
252 | 252 | def pick_binding(self, service, bindings=None, descr_type="", request=None,
|
253 |
| - entity_id=""): |
| 253 | + entity_id="", response=False): |
254 | 254 | if request and not entity_id:
|
255 | 255 | entity_id = request.issuer.text.strip()
|
256 | 256 |
|
@@ -284,7 +284,10 @@ def pick_binding(self, service, bindings=None, descr_type="", request=None,
|
284 | 284 | if srv["index"] == _index:
|
285 | 285 | return binding, srv["location"]
|
286 | 286 | else:
|
287 |
| - return binding, destinations(srvs)[0] |
| 287 | + if response: |
| 288 | + return binding, response_destinations(srvs)[0] |
| 289 | + else: |
| 290 | + return binding, destinations(srvs)[0] |
288 | 291 | except UnsupportedBinding:
|
289 | 292 | pass
|
290 | 293 |
|
@@ -351,7 +354,8 @@ def response_args(self, message, bindings=None, descr_type=""):
|
351 | 354 |
|
352 | 355 | binding, destination = self.pick_binding(rsrv, bindings,
|
353 | 356 | descr_type=descr_type,
|
354 |
| - request=message) |
| 357 | + request=message, |
| 358 | + response=True) |
355 | 359 | info["binding"] = binding
|
356 | 360 | info["destination"] = destination
|
357 | 361 |
|
|
0 commit comments