diff options
author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-25 09:29:28 +0000 |
---|---|---|
committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-07-25 09:29:28 +0000 |
commit | 890c5150e4e0ed3956d95d506ec391645a265090 (patch) | |
tree | d51709f26bde777749ab7740d81c3aa863315e27 /python/examples/logout.py | |
parent | 4b3094b60482030f773889d1395b17a2390c7473 (diff) | |
download | lasso-890c5150e4e0ed3956d95d506ec391645a265090.tar.gz lasso-890c5150e4e0ed3956d95d506ec391645a265090.tar.xz lasso-890c5150e4e0ed3956d95d506ec391645a265090.zip |
fix the problem of setting the user environ in SOAP method :
the problem : process_request_msg needs usr environ to verify federation
and authentication.
a solution :
first load the request msg
get the name identifier of the request
find the user dump from the name identifier and load it in logout object
process the request
see python/examples/logout.py for the methods.
Diffstat (limited to 'python/examples/logout.py')
-rw-r--r-- | python/examples/logout.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/python/examples/logout.py b/python/examples/logout.py index c4f13254..60cafe4c 100644 --- a/python/examples/logout.py +++ b/python/examples/logout.py @@ -37,7 +37,7 @@ idpuser_dump = "<LassoUser><LassoAssertions><LassoAssertion RemoteProviderID=\"h # SP1 build a request : sp1user = lasso.User.new_from_dump(sp1user_dump) -sp1logout = lasso.Logout.new(sp1server, sp1user, lasso.providerTypeSp) +sp1logout = lasso.Logout.new(lasso.providerTypeSp, sp1server, sp1user) sp1logout.init_request() sp1logout.build_request_msg() @@ -48,8 +48,7 @@ sp1logout.destroy() # IDP process request and return a response : idpuser = lasso.User.new_from_dump(idpuser_dump) -idplogout = lasso.Logout.new(idpserver, idpuser, lasso.providerTypeIdp) - +idplogout = lasso.Logout.new(lasso.providerTypeIdp, idpserver) if lasso.get_request_type_from_soap_msg(msg_body)==lasso.requestTypeLogout: print "it's a logout request !" @@ -57,7 +56,12 @@ if lasso.get_request_type_from_soap_msg(msg_body)==lasso.requestTypeLogout: #fake response, only for test ! response_msg_body = "<Envelope><LogoutResponse><ProviderID>https://service-provider2:2003/liberty-alliance/metadata</ProviderID><Status><StatusCode Value=\"Samlp:Success\"></StatusCode></Status></LogoutResponse></Envelope>" -idplogout.process_request_msg(msg_body, lasso.httpMethodSoap) +idplogout.load_request_msg(msg_body, lasso.httpMethodSoap) +nameIdentifier = idplogout.nameIdentifier +print "get the user dump from NameIdentifier : ", nameIdentifier +idplogout.load_user_dump(idpuser_dump) +idplogout.process_request() + next_provider_id = idplogout.get_next_providerID() while next_provider_id: idplogout.init_request(next_provider_id) @@ -69,5 +73,6 @@ while next_provider_id: next_provider_id = idplogout.get_next_providerID() +idplogout.build_response_msg() print "End of logout" |