Hi Olivier,
On 07 Oct 2014, at 16:43 pm, olivier jacques <
olivier.j...@gmail.com> wrote:
> Hello all,
>
> I'm getting the "Unable to validate Signature" message.
>
> Full backtrace is as follow :
>
> Validation with key #0 failed with exception: Unable to validate Signature
> SimpleSAML_Error_Error: UNHANDLEDEXCEPTION
> Backtrace:
> 0 /var/simplesamlphp/www/module.php:180 (N/A)
> Caused by: Exception: Unable to validate Signature
> I'm using simplesamlphp as a SP.
>
> When receiving response from IdP, I have in the response a Signature which contains SignedInfo, SignatureValue and KeyInfo.
> The Keyinfo contains a X509Certificate.
>
> The signature method is sha1 :
> <SignatureMethod Algorithm="
http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
>
> What I'm supposed to do is :
> 1. validate the embedded certificate with the root certificate the IdP gave me,
> 2. validate the signature with the embedded certificate.
No, what you are talking about here is PKI, and that’s out of the SAML trust model. In SAML, the trust is established by means of the metadata exchange, not by a hierarchy of certificates.
> I did try to do that manually (with some PHP test code), and it works fine, the signature is validated with the embedded certificate.
>
> I'm a bit confused because when I trace simplesamlphp code, it seems that it is trying to validate the signature with root certificate instead of the embedded certificate.
It’s trying to validate the signature with the certificate you configured, which in this case is the root certificate, not the one specified in the metadata as the one used for signing.
> If I comment in silplesamlphp code the validation of the signature, the assertion is correctly decrypted and I can have all the information about the user that is trying to logged.
You can just disable signature validation, instead of commenting out any code.
> What am I missing here ?
>
> Is simplesamlphp supposed to try to validated the signature with the embedded cert ?
As I said before, yes, SimpleSAMLphp does not support any kind of PKI validation procedures and the certificate you configure for a ceertain IdP is the one that will be used to verify signatures.
--
Jaime Pérez
UNINETT / Feide
mail:
jaime...@uninett.no
xmpp:
ja...@jabber.uninett.no
"Two roads diverged in a wood, and I, I took the one less traveled by, and that has made all the difference."
- Robert Frost