summaryrefslogtreecommitdiff
path: root/tests/test_44_authnresp.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_44_authnresp.py')
-rw-r--r--tests/test_44_authnresp.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/test_44_authnresp.py b/tests/test_44_authnresp.py
index 2059ba18..c6c405a3 100644
--- a/tests/test_44_authnresp.py
+++ b/tests/test_44_authnresp.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from saml2.saml import AUTHN_PASSWORD
+from saml2.authn_context import INTERNETPROTOCOLPASSWORD
from saml2 import saml
from saml2.server import Server
@@ -12,7 +12,8 @@ from pathutils import dotname, full_path
XML_RESPONSE_FILE = full_path("saml_signed.xml")
XML_RESPONSE_FILE2 = full_path("saml2_response.xml")
-def _eq(l1,l2):
+
+def _eq(l1, l2):
return set(l1) == set(l2)
IDENTITY = {"eduPersonAffiliation": ["staff", "member"],
@@ -20,36 +21,41 @@ IDENTITY = {"eduPersonAffiliation": ["staff", "member"],
"mail": ["foo@gmail.com"],
"title": ["shortstop"]}
+AUTHN = {
+ "class_ref": INTERNETPROTOCOLPASSWORD,
+ "authn_auth": "http://www.example.com/login"
+}
+
+
class TestAuthnResponse:
def setup_class(self):
server = Server(dotname("idp_conf"))
name_id = server.ident.transient_nameid(
"urn:mace:example.com:saml:roland:sp","id12")
- authn = (AUTHN_PASSWORD, "http://www.example.com/login")
self._resp_ = server.create_authn_response(
IDENTITY,
"id12", # in_response_to
"http://lingon.catalogix.se:8087/", # consumer_url
"urn:mace:example.com:saml:roland:sp", # sp_entity_id
- name_id = name_id,
- authn=authn)
+ name_id=name_id,
+ authn=AUTHN)
self._sign_resp_ = server.create_authn_response(
IDENTITY,
"id12", # in_response_to
"http://lingon.catalogix.se:8087/", # consumer_url
"urn:mace:example.com:saml:roland:sp", # sp_entity_id
- name_id = name_id, sign_assertion=True,
- authn=authn)
+ name_id=name_id, sign_assertion=True,
+ authn=AUTHN)
self._resp_authn = server.create_authn_response(
IDENTITY,
"id12", # in_response_to
"http://lingon.catalogix.se:8087/", # consumer_url
"urn:mace:example.com:saml:roland:sp", # sp_entity_id
- name_id = name_id,
- authn=authn)
+ name_id=name_id,
+ authn=AUTHN)
self.conf = config_factory("sp", dotname("server_conf"))
self.conf.only_use_keys_in_metadata = False
@@ -115,7 +121,7 @@ class TestAuthnResponse:
assert len(self.ar.assertion.authn_statement) == 1
authn_info = self.ar.authn_info()
assert len(authn_info) == 1
- assert authn_info[0][0] == saml.AUTHN_PASSWORD
+ assert authn_info[0][0] == INTERNETPROTOCOLPASSWORD
assert authn_info[0][1] == ["http://www.example.com/login"]
session_info = self.ar.session_info()
assert session_info["authn_info"] == authn_info