-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest lxml cannot retrieve AttributeValues #343
Comments
I get
when calling |
I did not have any issues with certs or the actual OneLogin code, just that function call (iterchildren) that was broken by the lxml library and could not retrieve the attributes anymore. Same python3-saml library, older lxml library and everything works. There are other open issues on this project related to that broken library. Seems like 'lxml>=4.6.5, !=4.7.0' is not quite right. |
@bitti you get that error when you are not providing a cert on the SP settings, but you enabled any flag related to sign AuthNrequest, LogoutRequest, LogoutResponse, Metadatra at the advanced settings. @acrividenco what version of python3-saml are you using? You can see in the last build that past the tests that lxml 4.9.2 was installed Can you check if the SAMLResponse was properly validated? Are we missing an specific case? |
@pitbulk thanks for the hint. But why should this surface through an update to |
In the latest version of python3-saml I removed some restrictions on the version of the lxml dependence. Read: |
I know, that's why I was wondering if it was related to the lxml update. Apparently not. The only other change which may be related seems to be #338, but that only seems to be related to IdP settings, not sp settings, so I'm at a loss here. |
@pitbulk: Ok, I just set a debug breakpoint at line 486, once for version 1.14.0 and once for 1.15.0. The decisive difference seems to be that the (Pdb) security
{'wantAttributeStatement': True, 'authnRequestsSigned': 'false'} It looks like this should be (Pdb) security
{'wantAttributeStatement': True} Should I open a separate ticket for this or do you already have an idea what the problem could be? |
The culprit is indeed #338. The problem goes away when I revert line https://github.com/SAML-Toolkits/python3-saml/pull/338/files#diff-27e3b11cb40e52fdab3ec806451468c5d1d347b6d43d75ed55f08b15b6831ed2R151. |
I'm seeing cases where having a encrypted response is giving me empty attributes too - is that related ? I notice the original issue was for attributes in saml response but the latest PR is in the IDP-metadata area and hence may not be related ? |
I have created a reproducible test case to show this issue: #370 I can reproduce this even with latest
Trying with older lxml:
|
Yes, this is exactly the issue. The response I had was encrypted. I didn't pay too much attention lately because I used the workaround mentioned in the beginning. |
I see. @pitbulk would be great to get this fixed and merged ! As of now, I am doing the following workaround if it helps anyone else: from onelogin.saml2.response import OneLogin_Saml2_Response
class MyResponse(OneLogin_Saml2_Response):
def _decrypt_assertion(self, xml):
xml = super()._decrypt_assertion(xml)
xml = copy.deepcopy(xml)
return xml
auth = OneLogin_Saml2_Auth(request_data, SAML_SETTINGS)
auth.response_class = MyResponse This will ensure that python3-saml can use any version of lxml |
Latest lxml (4.9.2) seems to have broken iterchildren, and the iteration linked below receives an empty attributes list.
I downgraded to lxml==4.6.5 and it works. I suggest updating the setup install_requires
python3-saml/src/onelogin/saml2/response.py
Line 597 in 538622d
The text was updated successfully, but these errors were encountered: