summaryrefslogtreecommitdiff
path: root/tests/test_51_client.py
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2014-12-24 20:13:03 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2015-04-06 17:18:12 -0700
commitf4169837c128cf64f3aa439ee9fa8833480b3139 (patch)
tree266430ce99aa06a9a8fe1230b6b2b89d1a582bfe /tests/test_51_client.py
parentd38e94715be08e838e0c9c51676604d1c82669d7 (diff)
downloadpysaml2-f4169837c128cf64f3aa439ee9fa8833480b3139.tar.gz
Add support for SingleSignOnService with HTTP-POST binding
Warning, this changes the return type of `prepare_for_authentication` by including the chosen binding, and opens the door for supporting other SingleSignOnService bindings.
Diffstat (limited to 'tests/test_51_client.py')
-rw-r--r--tests/test_51_client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_51_client.py b/tests/test_51_client.py
index a82a278b..eebbccf8 100644
--- a/tests/test_51_client.py
+++ b/tests/test_51_client.py
@@ -619,10 +619,11 @@ class TestClientWithDummy():
def test_do_authn(self):
binding = BINDING_HTTP_REDIRECT
response_binding = BINDING_HTTP_POST
- sid, http_args = self.client.prepare_for_authenticate(
+ sid, auth_binding, http_args = self.client.prepare_for_authenticate(
IDP, "http://www.example.com/relay_state",
binding=binding, response_binding=response_binding)
+ assert binding == auth_binding
assert isinstance(sid, basestring)
assert len(http_args) == 4
assert http_args["headers"][0][0] == "Location"
@@ -669,11 +670,13 @@ class TestClientWithDummy():
def test_post_sso(self):
binding = BINDING_HTTP_POST
response_binding = BINDING_HTTP_POST
- sid, http_args = self.client.prepare_for_authenticate(
+ sid, auth_binding, http_args = self.client.prepare_for_authenticate(
"urn:mace:example.com:saml:roland:idp", relay_state="really",
binding=binding, response_binding=response_binding)
_dic = unpack_form(http_args["data"][3])
+ assert binding == auth_binding
+
req = self.server.parse_authn_request(_dic["SAMLRequest"], binding)
resp_args = self.server.response_args(req.message, [response_binding])
assert resp_args["binding"] == response_binding