-
Notifications
You must be signed in to change notification settings - Fork 475
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 WantAssertionsSigned #536
Add WantAssertionsSigned #536
Conversation
…I don't understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small change needed for the readme, otherwise this looks good. Thank you for your contribution!
Prior to this pull request passport-saml's certificate check seems to work like this:
IMHO
i.e. that even if response was signed and even if response's signature was valid SP expects that assertion is also signed and that SP shall verify assertion's signature before consuming it. It looks like this pull request adds the possibility to set |
@srd90 , you make a good point. So it seems then for this PR to be truly compliant, it should actually perform more validations instead of just saying it does. @HendrikJan , are you able to add this additional validation. @srd90 any ideas how we might test that we performed the check? |
I've updated the pieces of code where @srd90 noticed the assertions' validation being skipped. Testing with SimpleSamlPHP confirms that we now get the error message "Invalid signature" when the IdP does not sign the assertions. I did not yet think about how to write a test for this.
|
There seems to be at least following scenarios which should be covered with new tests when passport-saml stack is configured with
|
@srd90 thanks for thinking about all those scenarios. |
I've added test 1 and 3 and an extra test to catch a missing cert when initializing saml. Now this branch cannot merge anymore. How should I proceed to fix the merge-conflict?
(The rebased branch can be found here: https://github.com/HendrikJan/passport-saml/tree/wantassertionssigned_rebase) |
…I don't understand.
This comment has been minimized.
This comment has been minimized.
Wantassertionssigned tmp
…wantassertionssigned
I've updated the test. In the following piece of code:
The line Also all tests have |
@HendrikJan This looks pretty good to me. I have a PR, #548 , that I'm eger to land first since it addresses a security concern, and would actually force changes in this PR. I wouldn't mind helping with merge conflicts if that is needed, but I'll hold off on approving this until I can manage to get the unexpectedly complicated #548 landed. I'm also interested to see if @srd90 has anything to say about your latest changes or what is in #548 which addresses the concerns that you and he raised in #523. |
@HendrikJan Would you like to do your resolve your merge conflicts so we can get this landed as part of the upcoming 3.x release? If you need help, please let me know. |
@cjbarth I'll have a look this weekend. |
@cjbarth I've resolved the merge conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things, but the overall code looks good. Thanks for be patient and cooperative with getting this landed.
…umer should be using.
Description
This is related to #533
This change adds the option "wantAssertionsSigned" to the SamlStrategy options.
When this option is set to true,
WantAssertionsSigned="true"
is added to the metadata when callingsamlStrategy.generateServiceProviderMetadata(...)
.When this option is set to false,
WantAssertionsSigned
is not added to the metadata, which is de default.This feature is described in the SAML Spec:
(Line 828 of this document: sstc-saml-metadata-errata-2.0-wd-04-diff.pdf )
The use-case is that some IdP's require
WantAssertionsSigned="true"
in the metadata that you send them.Please include tests. Doing so will ensure that the changes made in this PR are not undone or otherwise corrupted by future changes.
Checklist: