summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-07-11 10:57:35 +0200
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-07-11 10:57:40 +0200
commit050afd224676807a8003315e13ba4aee74d7a18a (patch)
tree8b1f1127a5b043aa553ffb078ae93ac97ab75f4f /bindings
parentf8ea3cda2df9919d57047626ee571893818e9193 (diff)
downloadlasso-050afd224676807a8003315e13ba4aee74d7a18a.tar.gz
lasso-050afd224676807a8003315e13ba4aee74d7a18a.tar.xz
lasso-050afd224676807a8003315e13ba4aee74d7a18a.zip
tests: add a SSO test with DSA keys to python bindings tests
Diffstat (limited to 'bindings')
-rwxr-xr-xbindings/python/tests/profiles_tests.py28
1 files changed, 28 insertions, 0 deletions
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."""