diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-06-29 09:15:02 +0000 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-06-29 09:15:02 +0000 |
commit | c1a4ba2fc03da5458a10b9a0daf32dbdcfa21ff3 (patch) | |
tree | 317c7fb3fbb194ec5db0a98add94c8ccc000120b /bindings | |
parent | 6f617027e9c46f3cb907e8bdbe1d3ef265d2b4d0 (diff) | |
download | lasso-c1a4ba2fc03da5458a10b9a0daf32dbdcfa21ff3.tar.gz lasso-c1a4ba2fc03da5458a10b9a0daf32dbdcfa21ff3.tar.xz lasso-c1a4ba2fc03da5458a10b9a0daf32dbdcfa21ff3.zip |
Merge branch 'issue-88'
Diffstat (limited to 'bindings')
-rwxr-xr-x | bindings/python/tests/binding_tests.py | 1 | ||||
-rwxr-xr-x | bindings/python/tests/profiles_tests.py | 51 |
2 files changed, 36 insertions, 16 deletions
diff --git a/bindings/python/tests/binding_tests.py b/bindings/python/tests/binding_tests.py index bd621215..89039d2e 100755 --- a/bindings/python/tests/binding_tests.py +++ b/bindings/python/tests/binding_tests.py @@ -293,7 +293,6 @@ class BindingTestCase(unittest.TestCase): mdata = os.path.join(dataDir, 'sp7-saml2', 'metadata.xml') password = file(os.path.join(dataDir, 'sp7-saml2', 'password')).read().strip() server = lasso.Server(mdata, pkey, password) - print server assert isinstance(server, lasso.Server) server_dump = server.dump() assert server_dump diff --git a/bindings/python/tests/profiles_tests.py b/bindings/python/tests/profiles_tests.py index 42cac2f9..c923f87f 100755 --- a/bindings/python/tests/profiles_tests.py +++ b/bindings/python/tests/profiles_tests.py @@ -208,6 +208,42 @@ class LoginTestCase(unittest.TestCase): self.failUnless('<action2>do action 2</action2>' in extensionsList[0]) self.failUnless('<action3>do action 3</action3>' in extensionsList[0]) + def test05(self): + '''SAMLv2 Authn request emitted and received using Artifact binding''' + + sp = lasso.Server( + os.path.join(dataDir, 'sp5-saml2/metadata.xml'), + os.path.join(dataDir, 'sp5-saml2/private-key.pem')) + assert sp + sp.addProvider( + lasso.PROVIDER_ROLE_IDP, + os.path.join(dataDir, 'idp5-saml2/metadata.xml')) + sp_login = lasso.Login(sp) + assert sp_login + sp_login.initAuthnRequest(None, lasso.HTTP_METHOD_ARTIFACT_GET) + sp_login.buildAuthnRequestMsg() + sp_login_dump = sp_login.dump() + idp = lasso.Server( + os.path.join(dataDir, 'idp5-saml2/metadata.xml'), + os.path.join(dataDir, 'idp5-saml2/private-key.pem')) + idp.addProvider( + lasso.PROVIDER_ROLE_SP, + os.path.join(dataDir, 'sp5-saml2/metadata.xml')) + idp_login = lasso.Login(idp) + idp_login.initRequest(sp_login.msgUrl.split('?')[1], lasso.HTTP_METHOD_ARTIFACT_GET) + idp_login.buildRequestMsg() + sp_login2 = lasso.Login.newFromDump(sp, sp_login_dump) + assert isinstance(sp_login2, lasso.Login) + assert idp_login.msgBody + sp_login2.processRequestMsg(idp_login.msgBody) + sp_login2.buildResponseMsg() + assert sp_login2.msgBody + try: + idp_login.processResponseMsg(sp_login2.msgBody) + except: + print idp_login.response + raise + assert isinstance(idp_login.request, lasso.Samlp2AuthnRequest) class LogoutTestCase(unittest.TestCase): def test01(self): @@ -294,21 +330,6 @@ class LogoutTestCase(unittest.TestCase): else: self.fail('Logout processResponseMsg should have failed.') - def test05(self): - """IDP logout; testing logout dump & newFromDump().""" - - lassoServer = lasso.Server( - os.path.join(dataDir, 'idp1-la/metadata.xml'), - os.path.join(dataDir, 'idp1-la/private-key-raw.pem'), - None, - os.path.join(dataDir, 'idp1-la/certificate.pem')) - lassoServer.addProvider( - lasso.PROVIDER_ROLE_SP, - os.path.join(dataDir, 'sp1-la/metadata.xml'), - os.path.join(dataDir, 'sp1-la/public-key.pem'), - os.path.join(dataDir, 'sp1-la/certificate.pem')) - - class DefederationTestCase(unittest.TestCase): def test01(self): """IDP initiated defederation; testing processNotificationMsg with non Liberty query.""" |