summaryrefslogtreecommitdiff
path: root/tests/test_51_client.py
diff options
context:
space:
mode:
authorJohan Lundberg <lundberg@sunet.se>2017-04-21 14:21:21 +0200
committerJohan Lundberg <lundberg@sunet.se>2017-04-21 14:21:21 +0200
commit4c6e454ee50d8d55adcdd9a5c1741b4df99a30d9 (patch)
treeb4dbacffbd5ecdce1eeaac766e0317a249421691 /tests/test_51_client.py
parenta0c510af7aa620a4c500d538bed44995084f389f (diff)
downloadpysaml2-4c6e454ee50d8d55adcdd9a5c1741b4df99a30d9.tar.gz
Allow to configuration option name_id_format_allow_create for sp config
Diffstat (limited to 'tests/test_51_client.py')
-rw-r--r--tests/test_51_client.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_51_client.py b/tests/test_51_client.py
index 13cef7cc..7e42045b 100644
--- a/tests/test_51_client.py
+++ b/tests/test_51_client.py
@@ -280,6 +280,26 @@ class TestClient:
assert nid_policy.allow_create == "false"
assert nid_policy.format == saml.NAMEID_FORMAT_TRANSIENT
+ def test_create_auth_request_nameid_policy_allow_create(self):
+ conf = config.SPConfig()
+ conf.load_file("sp_conf_nameidpolicy")
+ client = Saml2Client(conf)
+ ar_str = "%s" % client.create_authn_request(
+ "http://www.example.com/sso", message_id="id1")[1]
+
+ ar = samlp.authn_request_from_string(ar_str)
+ print(ar)
+ assert ar.assertion_consumer_service_url == ("http://lingon.catalogix"
+ ".se:8087/")
+ assert ar.destination == "http://www.example.com/sso"
+ assert ar.protocol_binding == BINDING_HTTP_POST
+ assert ar.version == "2.0"
+ assert ar.provider_name == "urn:mace:example.com:saml:roland:sp"
+ assert ar.issuer.text == "urn:mace:example.com:saml:roland:sp"
+ nid_policy = ar.name_id_policy
+ assert nid_policy.allow_create == "true"
+ assert nid_policy.format == saml.NAMEID_FORMAT_PERSISTENT
+
def test_create_auth_request_vo(self):
assert list(self.client.config.vorg.keys()) == [
"urn:mace:example.com:it:tek"]