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

Fix LogoutResponse issuer validation and implement SAML Response issuer validation. Related to Pull Request 116 #147

Merged
merged 11 commits into from Oct 31, 2014

Conversation

pitbulk
Copy link
Collaborator

@pitbulk pitbulk commented Sep 11, 2014

Review this PR, a solution for the #116

@pitbulk
Copy link
Collaborator Author

pitbulk commented Sep 11, 2014

@luisvm @inakidelamadrid @Lordnibbler , can you validate this so we can close this and the #116

@luisvm
Copy link
Contributor

luisvm commented Sep 11, 2014

👍 looks good, but what should we do with #116? that one seems to fix another issue as well https://github.com/onelogin/ruby-saml/pull/116/files#diff-58e0f05945ffec83ea2c44ce4e7b8550R34

@luisvm
Copy link
Contributor

luisvm commented Sep 11, 2014

you da man! :) got my thumbsup already

@pitbulk
Copy link
Collaborator Author

pitbulk commented Sep 11, 2014

Let's wait the review of @Lordnibbler

@luisvm
Copy link
Contributor

luisvm commented Sep 11, 2014

btw, we should add some specs

@@ -43,7 +45,9 @@ def saml_settings

settings.assertion_consumer_service_url = "http://#{request.host}/saml/finalize"
settings.issuer = request.host
settings.idp_sso_target_url = "https://app.onelogin.com/saml/signon/#{OneLoginAppId}"
settings.idp_entity_id = "https://app.onelogin.com/saml2/metadata/#{OneLoginAppId}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure you want to show these URLs to the world?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not?, we want our customers uses the toolkit to connect OneLogin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just double checking, you know better than me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @pitbulk I don't think the endpoint is correct, it states /saml2/metadata/<app-id> which I don't see is being defined anywhere in our routes, in any case that would be /saml/metadata/<app-id> instead.
The ones below are correct, though

@pitbulk
Copy link
Collaborator Author

pitbulk commented Oct 9, 2014

@Lordnibbler @luisvm What do you think of this PR? @luisvm where are the specs that you promised?

@pitbulk
Copy link
Collaborator Author

pitbulk commented Oct 9, 2014

I tested it against OL and simpleSAMLphp IdP and worked

@pwnetrationguru
Copy link
Contributor

Awesome! Looks good to me except for tests. Seems like we should have a few cases added to:

tests/logoutresponse_test.rb
tests/response_test.rb
tests/settings_test.rb

@pwnetrationguru
Copy link
Contributor

Looking into adding tests to this PR, and it appears we need a new test response XML file (test/test_helper.rb:24) that will generate a "Doesn't match the issuer, expected:" error.

Once we have the test file, we can test that the errors are correctly added. @pitbulk, an familiarity with how we might generate those sample files?

Also, we need to figure out how to ensure settings.idp_entity_id is not nil.

@pitbulk
Copy link
Collaborator Author

pitbulk commented Oct 9, 2014

I talked about that on this comment:
#115 (comment)

We have the php-saml toolkit and the python-saml toolkit for inspiration.
Those toolkits have its own test and use valid and invalid xmls for testing (tests/data/ folder)

Related to the settings.idp_entity_id, on the other toolkits I have a validator method on the settings class [1], this method is called in order to be sure that the inputs of the settings are ok, we could implement that method

[1] https://github.com/onelogin/php-saml/blob/master/lib/Saml2/Settings.php#L351 , https://github.com/onelogin/python-saml/blob/master/src/onelogin/saml2/settings.py#L301

@pwnetrationguru
Copy link
Contributor

@pitbulk, awesome, thanks! I'll look into those

@Lordnibbler
Copy link
Contributor

@pitbulk can you rebase off master? we cannot merge this PR cleanly

@pitbulk
Copy link
Collaborator Author

pitbulk commented Oct 16, 2014

@Lordnibbler , I thought that @pwnetrationguru was working on this issue. Does he need help?

@pwnetrationguru
Copy link
Contributor

I can add errors to @errors and modify the test to check for those errors. I think this PR needs to be rebased and then tests added for the functionality before I can do taht. From there I can finalize the PR by adding the necessary things to @errors and adding a few it blocks to the tests

@Lordnibbler
Copy link
Contributor

@pwnetrationguru please rebase and let me know if you need help

@pwnetrationguru
Copy link
Contributor

@pitbulk, there are merge conflicts with the rebase around the README, which seems to be a bulk of these changes. Can you please rebase issuer off of master and resolve the merge conflicts relating to README.md and then push?

I tried to resolve the conflicts, but it appears this PR updates information that is now outdated in the README

@pitbulk
Copy link
Collaborator Author

pitbulk commented Oct 28, 2014

@pwnetrationguru Done

@Lordnibbler
Copy link
Contributor

@pitbulk @luisvm @pwnetrationguru is this one good to merge?

@pitbulk
Copy link
Collaborator Author

pitbulk commented Oct 31, 2014

@Lordnibbler 👍 Ready for merge

Lordnibbler added a commit that referenced this pull request Oct 31, 2014
Fix LogoutResponse issuer validation and implement SAML Response issuer validation.  Related to Pull Request 116
@Lordnibbler Lordnibbler merged commit 34a43c9 into master Oct 31, 2014
@Lordnibbler Lordnibbler deleted the issuer branch October 31, 2014 04:05
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

Successfully merging this pull request may close these issues.

None yet

4 participants