Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add missing namespaces in LogoutRequest XML #137

Merged
merged 2 commits into from Dec 6, 2012

Conversation

Projects
None yet
2 participants
Contributor

adamcrown commented Dec 5, 2012

The undefined saml and samlp namesaces in the LogoutRequest XML
causes many XML parses to choke and prevents signle signout
requests from being processed by some clients.

This issue was covered extensively in #50 but the simple fix was never actually implemented. I though a fresh pull request might hurry things up.

@adamcrown adamcrown Add missing namespaces in LogoutRequest XML
The undefined saml and samlp namesaces in the LogoutRequest XML
causes many XML parses to choke and prevents signle signout
requests from being processed by some clients.
cdc7d7c
Contributor

mitfik commented Dec 5, 2012

Could you provide some simple example with test script?
Or information about how to reproduce this problem?
It will be good to have test for that for the future modifications.

Thanks a lot.

Contributor

adamcrown commented Dec 5, 2012

Well reproducing the problem is very straightforward as I'll show below. But I'll see if I can write a test to ensure that the XML sent from send_logout_notification_for_service_ticket is valid.

xml = '<samlp:LogoutRequest ID="#{rand}" Version="2.0" IssueInstant="#{time.rfc2822}"><saml:NameID></saml:NameID><samlp:SessionIndex>#{st.ticket}</samlp:SessionIndex></samlp:LogoutRequest>'
Nokogiri::XML(xml).at_xpath('//samlp:SessionIndex')

Trying to access namespaced element without a defined namespace as above will throw:

Nokogiri::XML::XPath::SyntaxError: Undefined namespace prefix: //samlp:SessionIndex

While the code below with the namespaces defined will return the XML element as expected.

xml = '<samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="#{rand}" Version="2.0" IssueInstant="#{time.rfc2822}"><saml:NameID></saml:NameID><samlp:SessionIndex>#{st.ticket}</samlp:SessionIndex></samlp:LogoutRequest>'
Nokogiri::XML(xml).at_xpath('//samlp:SessionIndex')
@adamcrown adamcrown Test that single sign out XML is valid.
This test will ensure that the single sign out XML can be parsed
and the service ticket can be retrieved.
b9fefdf

@mitfik mitfik was assigned Dec 6, 2012

@mitfik mitfik added a commit that referenced this pull request Dec 6, 2012

@mitfik mitfik Merge pull request #137 from biola/logout_request_xml_fix
Add missing namespaces in LogoutRequest XML
d35b17f

@mitfik mitfik merged commit d35b17f into rubycas:master Dec 6, 2012

Contributor

mitfik commented Dec 6, 2012

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment