Skip to content

IdP metadata parser: fix singleSignOnService processing#16

Merged
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
jgehrcke:jp/fixparser
Apr 28, 2016
Merged

IdP metadata parser: fix singleSignOnService processing#16
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
jgehrcke:jp/fixparser

Conversation

@jgehrcke
Copy link
Copy Markdown
Contributor

There is a typo in the new idp_metadata_parser module: it consumes the singleLogoutService XML tag for populating idp_sso_url, instead of the singleSignOnService tag. This PR fixes the typo and adjusts the tests.

Parser tests pass:

$ python setup.py test --test-suite tests.src.OneLogin.saml2_tests.idp_metadata_parser_test
running test
Searching for xmlsec>=0.6.0
Best match: xmlsec 0.6.0
Processing xmlsec-0.6.0-py3.4-linux-x86_64.egg

Using /home/jp/dev/python3-saml/.eggs/xmlsec-0.6.0-py3.4-linux-x86_64.egg
Searching for isodate>=0.5.0
Best match: isodate 0.5.4
Processing isodate-0.5.4-py3.4.egg

Using /home/jp/dev/python3-saml/.eggs/isodate-0.5.4-py3.4.egg
running egg_info
writing dependency_links to src/python3_saml.egg-info/dependency_links.txt
writing src/python3_saml.egg-info/PKG-INFO
writing top-level names to src/python3_saml.egg-info/top_level.txt
writing requirements to src/python3_saml.egg-info/requires.txt
reading manifest file 'src/python3_saml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
writing manifest file 'src/python3_saml.egg-info/SOURCES.txt'
running build_ext
testGetMetadata (tests.src.OneLogin.saml2_tests.idp_metadata_parser_test.OneLogin_Saml2_IdPMetadataParser_Test) ... ok
testMergeSettings (tests.src.OneLogin.saml2_tests.idp_metadata_parser_test.OneLogin_Saml2_IdPMetadataParser_Test) ... ok
testParse (tests.src.OneLogin.saml2_tests.idp_metadata_parser_test.OneLogin_Saml2_IdPMetadataParser_Test) ... ok
testParseRemote (tests.src.OneLogin.saml2_tests.idp_metadata_parser_test.OneLogin_Saml2_IdPMetadataParser_Test) ... ok

----------------------------------------------------------------------
Ran 4 tests in 2.137s

OK

Note that the test data also specifies SingleLogoutServices:

$ curl https://www.testshib.org/metadata/testshib-providers.xml | grep -i singlelogout
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20563  100 20563    0     0  17912      0  0:00:01  0:00:01 --:--:-- 17927
            <SingleLogoutService Location="https://sp.testshib.org/Shibboleth.sso/SLO/SOAP"
            <SingleLogoutService Location="https://sp.testshib.org/Shibboleth.sso/SLO/Redirect"
            <SingleLogoutService Location="https://sp.testshib.org/Shibboleth.sso/SLO/POST"
            <SingleLogoutService Location="https://sp.testshib.org/Shibboleth.sso/SLO/Artifact"

They are part of the SPSSODescriptor tag which is not looked into by the IdP parser. So, the expected_data in the tests does not contain any SLSs.

That's the data the IdP parser currently (with the change from this PR) creates when parsing https://www.testshib.org/metadata/testshib-providers.xml:

{
    "sp": {
        "NameIDFormat": "urn:mace:shibboleth:1.0:nameIdentifier"
    },
    "idp": {
        "singleSignOnService": {
            "url": "https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO"
        },
        "entityId": "https://idp.testshib.org/idp/shibboleth"
    }
}

@pitbulk I hope this is now as expected. Please review, thanks!

@pitbulk pitbulk merged commit 43ff778 into SAML-Toolkits:master Apr 28, 2016
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.

2 participants