diff options
author | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-01-28 10:05:58 +0100 |
---|---|---|
committer | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-01-28 10:05:58 +0100 |
commit | 643e92a0cd031b5ee4ba99b5497f5bb536dfdf91 (patch) | |
tree | 7e8d9ca1a02031d084b7142aa89ca909bb215b22 | |
parent | d0d038160fa6c0377a06b2ed3370b6588ba6e81a (diff) | |
download | pysaml2-643e92a0cd031b5ee4ba99b5497f5bb536dfdf91.tar.gz |
Added missing small pieces
-rw-r--r-- | src/saml2/entity.py | 4 | ||||
-rw-r--r-- | src/saml2/response.py | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/saml2/entity.py b/src/saml2/entity.py index 3a7d8f5f..8e191875 100644 --- a/src/saml2/entity.py +++ b/src/saml2/entity.py @@ -222,6 +222,7 @@ class Entity(HTTPBase): elif isinstance(message, LogoutRequest): rsrv = "single_logout_service" elif isinstance(message, AttributeQuery): + info["sp_entity_id"] = message.issuer.text rsrv = "attribute_consuming_service" descr_type = "sp_sso" elif isinstance(message, ManageNameIDRequest): @@ -238,6 +239,9 @@ class Entity(HTTPBase): else: raise Exception("No support for this type of query") + if bindings == [BINDING_SOAP]: + return info + if rsrv: if not descr_type: if self.entity_type == "sp": diff --git a/src/saml2/response.py b/src/saml2/response.py index 0f7d8460..3569fd85 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -49,7 +49,10 @@ logger = logging.getLogger(__name__) class IncorrectlySigned(Exception): pass - + +class VerificationError(Exception): + pass + # --------------------------------------------------------------------------- def _dummy(_): @@ -483,7 +486,7 @@ class AuthnResponse(StatusResponse): subjconf.append(subject_confirmation) if not subjconf: - raise Exception("No valid subject confirmation") + raise VerificationError("No valid subject confirmation") subject.subject_confirmation = subjconf @@ -506,7 +509,7 @@ class AuthnResponse(StatusResponse): # self.authn_statement_ok(True) if not self.condition_ok(): - return None + raise VerificationError("Condition not OK") logger.debug("--- Getting Identity ---") @@ -521,11 +524,11 @@ class AuthnResponse(StatusResponse): if self.allow_unsolicited: pass elif not self.came_from: - return False + raise VerificationError("Came from") return True except Exception, exc: logger.exception("get subject") - return False + raise def _encrypted_assertion(self, xmlstr): if xmlstr.encrypted_data: |