summaryrefslogtreecommitdiff
path: root/src/saml2/client.py
diff options
context:
space:
mode:
authorAndrew Wason <rectalogic@rectalogic.com>2013-04-23 10:23:58 -0400
committerAndrew Wason <rectalogic@rectalogic.com>2013-04-23 10:27:19 -0400
commitf8ab0abffd271fbf2865d434bfa5bd97e0538725 (patch)
tree775e86d18b526773206e0f5783beec6737cda735 /src/saml2/client.py
parentf806786f6dad8fc2b03daa0e1d55682daead3ec8 (diff)
downloadpysaml2-f8ab0abffd271fbf2865d434bfa5bd97e0538725.tar.gz
ProtocolBinding in AuthnRequest indicates how response should be delivered, not how the request is being delivered.
Saml2Client.prepare_for_authenticate() needs to distinguish between the request binding (how the request will be delivered) and the response binding (how the response should be delivered, indicated by ProtocolBinding in the request XML).
Diffstat (limited to 'src/saml2/client.py')
-rw-r--r--src/saml2/client.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/saml2/client.py b/src/saml2/client.py
index 9919492b..c23fc8c2 100644
--- a/src/saml2/client.py
+++ b/src/saml2/client.py
@@ -60,7 +60,8 @@ class Saml2Client(Base):
binding=saml2.BINDING_HTTP_REDIRECT, vorg="",
nameid_format=NAMEID_FORMAT_PERSISTENT,
scoping=None, consent=None, extensions=None,
- sign=None):
+ sign=None,
+ response_binding=saml2.BINDING_HTTP_POST):
""" Makes all necessary preparations for an authentication request.
:param entityid: The entity ID of the IdP to send the request to
@@ -72,14 +73,15 @@ class Saml2Client(Base):
:param consent: Whether the principal have given her consent
:param extensions: Possible extensions
:param sign: Whether the request should be signed or not.
+ :param response_binding: Which binding to use for receiving the response
:return: session id and AuthnRequest info
"""
destination = self._sso_location(entityid, binding)
- req = self.create_authn_request(destination, vorg, scoping, binding,
- nameid_format, consent, extensions,
- sign)
+ req = self.create_authn_request(destination, vorg, scoping,
+ response_binding, nameid_format,
+ consent, extensions, sign)
_req_str = "%s" % req
logger.info("AuthNReq: %s" % _req_str)