diff options
author | peppelinux <giuseppe.demarco@unical.it> | 2021-01-24 01:56:02 +0100 |
---|---|---|
committer | peppelinux <giuseppe.demarco@unical.it> | 2021-01-24 01:56:33 +0100 |
commit | 8672d10cd4086e5e22adce925a1264c4c076fecb (patch) | |
tree | 97353cabac5ba69b44d13c7f5a2f88679ba69eb1 | |
parent | 7f1119737838ad0e9cf0c2e8ac2d34f9d66a1ab9 (diff) | |
download | pysaml2-8672d10cd4086e5e22adce925a1264c4c076fecb.tar.gz |
InvalidASsertion Exception
-rw-r--r-- | src/saml2/response.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/saml2/response.py b/src/saml2/response.py index 50e4f6b0..70e2a8c1 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -67,6 +67,10 @@ class IncorrectlySigned(SAMLError): pass +class InvalidAssertion(SAMLError): + pass + + class DecryptionFailed(SAMLError): pass @@ -920,7 +924,7 @@ class AuthnResponse(StatusResponse): n_assertions = len(self.response.assertion) n_assertions_enc = len(self.response.encrypted_assertion) if n_assertions != 1 and n_assertions_enc != 1 and self.assertion is None: - raise Exception( + raise InvalidAssertion( "Invalid number of assertions in Response: {n}".format( n=n_assertions+n_assertions_enc ) |