Skip to content

Commit 8672d10

Browse files
committed
InvalidASsertion Exception
1 parent 7f11197 commit 8672d10

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/saml2/response.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ class IncorrectlySigned(SAMLError):
6767
pass
6868

6969

70+
class InvalidAssertion(SAMLError):
71+
pass
72+
73+
7074
class DecryptionFailed(SAMLError):
7175
pass
7276

@@ -920,7 +924,7 @@ def parse_assertion(self, keys=None):
920924
n_assertions = len(self.response.assertion)
921925
n_assertions_enc = len(self.response.encrypted_assertion)
922926
if n_assertions != 1 and n_assertions_enc != 1 and self.assertion is None:
923-
raise Exception(
927+
raise InvalidAssertion(
924928
"Invalid number of assertions in Response: {n}".format(
925929
n=n_assertions+n_assertions_enc
926930
)

0 commit comments

Comments
 (0)