-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Using parseLoginResponse leads to typeError #222
Comments
@laimikko1 After a quick review, there are mainly two problems. When you construct the IdP, please also set I will fix the parser later on. Meanwhile, you can configure your IdP metadata as follow and continue your internal testing. <KeyDescriptor use="signing">
<KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<X509Data>
<X509Certificate>...</X509Certificate>
</X509Data>
</KeyInfo>
</KeyDescriptor>
<KeyDescriptor use="encryption">
<KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<X509Data>
<X509Certificate>...</X509Certificate>
</X509Data>
</KeyInfo>
</KeyDescriptor> |
The latest version should support the certificate declaration with/without declaring |
Thanks for the response and patch.
and it now returns a valid response.
Idp also expects us to sign our auth request so I modified my SP metadata to match that. I'm still using the test idp metadata. I've modifed it a bit as you instructed. It can be seen below
Also, logging my idp and SP certificates, I can see that my SP uses, for both signing and encryption, the certificate outlined in metadata. sp
And idp also uses the cert for signing that I outlined in the metadata.
I tried to validate my SAML response using an online SAML response tool. I added my SP private key, the idp cert that's in use for signing the response and the correct assertion urls. etc, and it was a valid response. However, when trying to parse the response, I get
I'd expect the signature cert to be the same for both message and assertion signing for the idp. I also checked the SAML response and the signature cert matched the one outlined in my idp for signing and the encryption cert matched the one outlined in my SP. Here's my received SAML response. I've removed unnecessary data, hopefully it's still readable.
|
@laimikko1 You may need to define |
Ignore my above mentioned comment, the default value is still there. |
@laimikko1 I think I may know the problem. In order to get the highest level of data integrity check, IDP signs the assertion first, the next step is to encrypt the assertion, then finally signs the entire message. By default, the Once the assertion is being decrypt, the structure will become
In our current implementation, we will verify the message signature first, however, the message signature is signed when the assertion is being encrypted. Therefore, the signature verification will fail. I will review the flow soon. Thanks for your report. |
It works now. The mistake was on my end as I thought our idp provider implemented 'sign-then-encrypt' instead of 'encrypt-then-sign'. Another issue I ran into was that our idp doesn't set
attribute in it's metadata, but still expects authnrequests to be signed. I couldn't get Samlify to recognize that the requests must be signed by modifying idp entitySettings, so I bypassed it by adding the value to the xml metadata manually. Thanks for your help on the issue! |
We are using Samlify as an SP and authenticating using a 3rd party idp solution.
At first I tried to set up our SP and idp as advised in the documentation
and idp using the metadata, returned to us by the WAYF/DS service that our idp provider uses
This worked pretty far, as I was able to redirect our login request from our 3rd party WAYF/DS to the test idp login service, managed to authenticate and received a SAML response.
However, when trying to parse the login response using
I catched the following error
After a bit of head scratching I realised that the assertion of the response is probably both signed and encrypted. I then followed the Samlify documentation and modified my sp
And added
to my SP metadata.
(We are using the same certificate for everything in our testing environment.)
I then tried to parse the login response but received the same error as above.
Here's our idp and SP logged:
What stands out is the empty certificate in meta information.
Our test idp metadata is public and found at
https://testidp.funet.fi/idp/shibboleth
Our SP metadata is published at
https://defa-staging.cs.helsinki.fi/api/login/metadata
If you require other information, feel free to ask and I'll try to provide it. Thanks!
The text was updated successfully, but these errors were encountered: