authentik.sources.saml.exceptions
authentik saml source exceptions
1"""authentik saml source exceptions""" 2 3from authentik.lib.sentry import SentryIgnoredException 4 5 6class SAMLException(SentryIgnoredException): 7 """Base SAML Exception""" 8 9 default_message = "An unspecified SAML error occurred." 10 11 def __str__(self): 12 if self.args: 13 return super().__str__() 14 return self.default_message 15 16 17class InvalidEncryption(SAMLException): 18 """Encryption of XML Object is either missing or invalid.""" 19 20 default_message = "The encryption of the SAML object is either missing or invalid." 21 22 23class InvalidSignature(SAMLException): 24 """Signature of XML Object is either missing or invalid.""" 25 26 default_message = "The signature of the SAML object is either missing or invalid." 27 28 29class MismatchedRequestID(SAMLException): 30 """Exception raised when the returned request ID doesn't match the saved ID.""" 31 32 default_message = "The SAML Response ID does not match the original request ID." 33 34 35class MissingSAMLResponse(SAMLException): 36 """Exception raised when request does not contain SAML Response.""" 37 38 default_message = "Request does not contain a SAML response." 39 40 41class UnsupportedNameIDFormat(SAMLException): 42 """Exception raised when SAML Response contains NameID Format not supported.""" 43 44 default_message = "The NameID Format in the SAML Response is not supported."
7class SAMLException(SentryIgnoredException): 8 """Base SAML Exception""" 9 10 default_message = "An unspecified SAML error occurred." 11 12 def __str__(self): 13 if self.args: 14 return super().__str__() 15 return self.default_message
Base SAML Exception
18class InvalidEncryption(SAMLException): 19 """Encryption of XML Object is either missing or invalid.""" 20 21 default_message = "The encryption of the SAML object is either missing or invalid."
Encryption of XML Object is either missing or invalid.
24class InvalidSignature(SAMLException): 25 """Signature of XML Object is either missing or invalid.""" 26 27 default_message = "The signature of the SAML object is either missing or invalid."
Signature of XML Object is either missing or invalid.
30class MismatchedRequestID(SAMLException): 31 """Exception raised when the returned request ID doesn't match the saved ID.""" 32 33 default_message = "The SAML Response ID does not match the original request ID."
Exception raised when the returned request ID doesn't match the saved ID.
36class MissingSAMLResponse(SAMLException): 37 """Exception raised when request does not contain SAML Response.""" 38 39 default_message = "Request does not contain a SAML response."
Exception raised when request does not contain SAML Response.
42class UnsupportedNameIDFormat(SAMLException): 43 """Exception raised when SAML Response contains NameID Format not supported.""" 44 45 default_message = "The NameID Format in the SAML Response is not supported."
Exception raised when SAML Response contains NameID Format not supported.