summaryrefslogtreecommitdiffstats
path: root/python/examples/defederation.py
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-07-19 12:25:35 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-07-19 12:25:35 +0000
commit8c0b0cb66780eb70c8f2cc0331bdaf4f78c8fc48 (patch)
treebf46ad727891d3a9126fa679a1680b2c75df2f30 /python/examples/defederation.py
parent6585a27baffa20d757d1d93cf11264cb593a6910 (diff)
downloadlasso-8c0b0cb66780eb70c8f2cc0331bdaf4f78c8fc48.tar.gz
lasso-8c0b0cb66780eb70c8f2cc0331bdaf4f78c8fc48.tar.xz
lasso-8c0b0cb66780eb70c8f2cc0331bdaf4f78c8fc48.zip
update federation termination
Diffstat (limited to 'python/examples/defederation.py')
-rw-r--r--python/examples/defederation.py45
1 files changed, 36 insertions, 9 deletions
diff --git a/python/examples/defederation.py b/python/examples/defederation.py
index 82805097..1522945f 100644
--- a/python/examples/defederation.py
+++ b/python/examples/defederation.py
@@ -6,18 +6,45 @@ import lasso
lasso.init()
-notification = lasso.FederationTerminationNotification.new("http://providerid.com",
- "CDSC7SCD65SCDSDCCDS", "http://qualifier.com", "federated")
+# servers :
+spserver = lasso.Server.new("../../examples/sp.xml",
+ "../../examples/rsapub.pem", "../../examples/rsakey.pem", "../../examples/rsacert.pem",
+ lasso.signatureMethodRsaSha1)
-query = notification.url_encode(0, './rsakey.pem')
-print query
+spserver.add_provider("../../examples/idp.xml", None, None)
-notification2 = lasso.FederationTerminationNotification.new_from_query(query)
-print notification2.dump()
+idpserver = lasso.Server.new("../../examples/idp.xml",
+ "../../examples/rsapub.pem", "../../examples/rsakey.pem", "../../examples/rsacert.pem",
+ lasso.signatureMethodRsaSha1)
-soap = notification.soap_envelop()
+spserver.add_provider("../../examples/sp.xml", None, None)
-notification3 = lasso.FederationTerminationNotification.new_from_soap(soap)
-print notification3.dump()
+# users :
+spuser_dump = "<LassoUser><LassoIdentities><LassoIdentity RemoteProviderID=\"https://identity-provider:2003/liberty-alliance/metadata\"><LassoRemoteNameIdentifier><NameIdentifier NameQualifier=\"qualifier.com\" Format=\"federated\">LLLLLLLLLLLLLLLLLLLLLLLLL</NameIdentifier></LassoRemoteNameIdentifier></LassoIdentity></LassoIdentities></LassoUser>"
+
+spuser = lasso.User.new_from_dump(spuser_dump)
+
+idpuser_dump = "<LassoUser><LassoIdentities><LassoIdentity RemoteProviderID=\"https://service-provider:2003/liberty-alliance/metadata\"><LassoLocalNameIdentifier><NameIdentifier NameQualifier=\"qualifier.com\" Format=\"federated\">LLLLLLLLLLLLLLLLLLLLLLLLL</NameIdentifier></LassoLocalNameIdentifier></LassoIdentity></LassoIdentities></LassoUser>"
+
+idpuser = lasso.User.new_from_dump(idpuser_dump)
+
+# sp federation termination :
+spdefederation = lasso.FederationTermination.new(spserver, spuser, lasso.providerTypeSp)
+spdefederation.init_notification("https://identity-provider:2003/liberty-alliance/metadata")
+spdefederation.build_notification_msg()
+print 'url : ', spdefederation.msg_url
+print 'body : ', spdefederation.msg_body
+
+# idp federation termination :
+print "---------------------------------------------------------"
+print " At identity provider "
+idpdefederation = lasso.FederationTermination.new(idpserver, idpuser, lasso.providerTypeIdp)
+idpdefederation.process_notification_msg(spdefederation.msg_body, lasso.httpMethodSoap)
+#idpdefederation.build_response_msg()
+#print 'url : ', idpdefederation.msg_url
+#print 'body : ', idpdefederation.msg_body
+
+
+print 'End of federation termination'
lasso.shutdown()