From 050afd224676807a8003315e13ba4aee74d7a18a Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 11 Jul 2012 10:57:35 +0200 Subject: tests: add a SSO test with DSA keys to python bindings tests --- bindings/python/tests/profiles_tests.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'bindings') diff --git a/bindings/python/tests/profiles_tests.py b/bindings/python/tests/profiles_tests.py index f5fd4637..0068d841 100755 --- a/bindings/python/tests/profiles_tests.py +++ b/bindings/python/tests/profiles_tests.py @@ -272,6 +272,34 @@ class LoginTestCase(unittest.TestCase): sp_login.processAuthnResponseMsg(idp_login.msgBody) sp_login.acceptSso() + def test07(self): + '''SAMLv2 SSO with DSA key for the IdP''' + 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, 'idp12-dsa-saml2/metadata.xml')) + sp_login = lasso.Login(sp) + assert sp_login + sp_login.initAuthnRequest(None, lasso.HTTP_METHOD_REDIRECT) + sp_login.buildAuthnRequestMsg() + idp = lasso.Server( + os.path.join(dataDir, 'idp12-dsa-saml2/metadata.xml'), + os.path.join(dataDir, 'idp12-dsa-saml2/private-key.pem')) + idp.signatureMethod = lasso.SIGNATURE_METHOD_DSA_SHA1 + idp.addProvider( + lasso.PROVIDER_ROLE_SP, + os.path.join(dataDir, 'sp5-saml2/metadata.xml')) + idp_login = lasso.Login(idp) + print sp_login.msgUrl + idp_login.processAuthnRequestMsg(sp_login.msgUrl.split('?')[1]) + idp_login.protocolProfile = lasso.LOGIN_PROTOCOL_PROFILE_BRWS_POST; + idp_login.validateRequestMsg(True, True) + idp_login.buildAssertion("None", "None", "None", "None", "None") + idp_login.buildAuthnResponseMsg() + class LogoutTestCase(unittest.TestCase): def test01(self): """SP logout without session and identity; testing initRequest.""" -- cgit