diff --git a/src/onelogin/saml2/response.py b/src/onelogin/saml2/response.py index f93f756e..c5a652d7 100644 --- a/src/onelogin/saml2/response.py +++ b/src/onelogin/saml2/response.py @@ -114,11 +114,6 @@ def is_valid(self, request_data, request_id=None): if len(encrypted_nameid_nodes) == 0: raise Exception('The NameID of the Response is not encrypted and the SP require it') - # Checks that there is at least one AttributeStatement - attribute_statement_nodes = self.__query_assertion('/saml:AttributeStatement') - if not attribute_statement_nodes: - raise Exception('There is no AttributeStatement on the Response') - # Validates Asserion timestamps if not self.validate_timestamps(): raise Exception('Timing issues (please check your clock settings)') diff --git a/tests/src/OneLogin/saml2_tests/response_test.py b/tests/src/OneLogin/saml2_tests/response_test.py index aae4d3c2..d3e23080 100644 --- a/tests/src/OneLogin/saml2_tests/response_test.py +++ b/tests/src/OneLogin/saml2_tests/response_test.py @@ -421,25 +421,6 @@ def testIsInValidExpired(self): except Exception as e: self.assertEqual('Timing issues (please check your clock settings)', e.message) - def testIsInValidNoStatement(self): - """ - Tests the is_valid method of the OneLogin_Saml2_Response - Case no statement - """ - settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'no_signature.xml.base64')) - response = OneLogin_Saml2_Response(settings, xml) - response.is_valid(self.get_request_data()) - self.assertEqual('No Signature found. SAML Response rejected', response.get_error()) - - settings.set_strict(True) - response_2 = OneLogin_Saml2_Response(settings, xml) - try: - valid = response_2.is_valid(self.get_request_data()) - self.assertFalse(valid) - except Exception as e: - self.assertEqual('There is no AttributeStatement on the Response', e.message) - def testIsInValidNoKey(self): """ Tests the is_valid method of the OneLogin_Saml2_Response