-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
add_sign tampering with the xml, resulting in invalid signature #231
Comments
@RamezIssac have you tried to validate the generated XML with the validate_sign method? Also, try to use python3-saml and see if it also give you the same issue. |
@pitbulk Thank you for the quick reply
` I'll test wtih Python3 and get back to you. |
Same behavior on Python3-saml , validate_sign return False. |
Hello again , Were this bug re-produce-able on your end ? Thank you in advance. |
The method OneLogin_Saml2_Utils.validate_sign by default only supports validate signatures of Message or Assertion if no xpath parameter provided. So the use you do on your script will get always a False value on validation due in the XML there is no Response or Assertion element. You may modify the use of validate_sign as follows. Replace: OneLogin_Saml2_Utils.validate_sign(signed_xml, cert, key, signatureAlgorithm, validatecert=False) by OneLogin_Saml2_Utils.validate_sign(signed_xml, cert, key, signatureAlgorithm, validatecert=False, xpath='/samlp:AuthnRequest/ds:Signature') |
Thank you for the reply and for the guide on how to use validate_sign validating authn_request. Unfortunately, |
It worked for me with the code on master |
Ok can you please share the code you use to add the signature to the authn_request please ? |
The same script code that you shared but with the changes I provided |
Ok, This is embracing. Thank you indeed for your help and time. Closing issue. |
Good day dear,
I'm implementing HTTP-POST which is requiring enveloped signatures.
I implemented your hint on the php repo (and here on other issues) using
add_sign
But, indeed
add_sign
do tamper with the resulting xml (as in #148 ).I reviewed your commit 5e08bb2 , it certainly look way better at solving the issue but unfortunately it still yields an invalid signature from the idp.
On a side note: If i sign the xml request on the onelogin site online tools, i get through and have no errors.
How can i help resolving this issue ?
Thank you.
The text was updated successfully, but these errors were encountered: