Skip to content
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

Trying to use add_sign adds new line characters in embedded signature #148

Closed
gsvitak opened this issue Jun 12, 2016 · 2 comments
Closed

Comments

@gsvitak
Copy link

gsvitak commented Jun 12, 2016

Hello,

I was noticed in #78 that the signature was not using the signature api. I am trying to use the OneLogin_Saml2_Utils.add_sign method to embed the signature in the AuthnRequest for the HTTP-POST binding. The method works great but it appears to add new lines/carriage returns to the signature value.

Based on the HTTP-POST sample (https://www.samltool.com/generic_sso_req.php), I think the new lines/carriage returns will cause issues with the IDP.

Can you please confirm if the extra characters will cause an issue? Also, can you please offer a suggestion on how to eliminate the characters?

I have validated my SP cert and private key are formatted properly by stepping through the constructor of OneLogin_Saml2_Settings

self.format_sp_cert()
self.format_sp_key()

Thanks for the help in advance.
Greg

<ds:SignatureValue>R/+/4XFlWhEptIXukn5hkkalFimlutchfYlEoVMhTWd+QlId818h1CiplPSlUnGZ
         Eor55SNaXdn8vdyDv54MmYkMJRW1+kp+/P7HijVWaCisR5hXghZnazLXWkFJOyuH
         k2MQCT7ZIe4EDmsRZterDfRlcpqdlNfWJkXKq07EmuqgiPF6t8WtVBxrEZ/Pcu3+
         GY8K4+p0KgJp3ocr985+Zbyo9jtepO4+xRjyEfL3CqfHLR6+Xa91A1DH2oAVJTZZ
         HCC2iy30zRqGACoHHTd2mEcyG3i5n456W3LEYE/xNeVu3bL3/EdRNUP+gcyLGL9f STDwaxGbuJx00cjtT8bKjQ==</ds:SignatureValue> 
@pitbulk
Copy link
Contributor

pitbulk commented Jun 30, 2016

AuthnRequest HTTP-POST binding is not supported by this toolkit.

What extra spaces are added by OneLogin_Saml2_Utils.add_sign ?

@gsvitak
Copy link
Author

gsvitak commented Jul 7, 2016

After further debugging the issue, the problem with using the OneLogin_Saml2_Utils.add_sign for a post is not the extra spaces. If you use the method to sign the XML request for posting to an IDP, the method add the namespace attributes to the XML after the document is signed. This causes the signature to become invalid.

I used your suggestion from #78 and forked the repo to add some methods to support HTTP-POST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants