summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2013-02-17 20:50:45 +0100
committerRoland Hedberg <roland.hedberg@adm.umu.se>2013-02-17 20:50:45 +0100
commit0d45a31259944ecb81964ec704b287697c4fb80a (patch)
tree6c00c06dfebaae064ee3cb9de9b46317845769ef /src
parent9bbbfc29625aab6638428ef712aad21e42f51685 (diff)
downloadpysaml2-0d45a31259944ecb81964ec704b287697c4fb80a.tar.gz
Request HTTP response contains content not error.
Bug in key calculation.
Diffstat (limited to 'src')
-rw-r--r--src/saml2/httpbase.py2
-rw-r--r--src/saml2/server.py10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/saml2/httpbase.py b/src/saml2/httpbase.py
index 9643e839..26aa5519 100644
--- a/src/saml2/httpbase.py
+++ b/src/saml2/httpbase.py
@@ -304,7 +304,7 @@ class HTTPBase(object):
logger.info("SOAP response: %s" % response.text)
return response
else:
- raise HTTPError("%d:%s" % (response.status_code, response.error))
+ raise HTTPError("%d:%s" % (response.status_code, response.content))
def add_credentials(self, user, passwd):
self.user = user
diff --git a/src/saml2/server.py b/src/saml2/server.py
index 6bc04d04..b53d6c67 100644
--- a/src/saml2/server.py
+++ b/src/saml2/server.py
@@ -224,8 +224,14 @@ class Server(Entity):
:return:
"""
result = []
- key = sha1("%s" % name_id).hexdigest()
- for statement in self.authn[key]:
+ key = sha1(code(name_id)).hexdigest()
+ try:
+ statements = self.authn[key]
+ except KeyError:
+ logger.info("Unknown subject %s" % name_id)
+ return []
+
+ for statement in statements:
if session_index:
if statement.session_index != session_index:
continue