diff options
| -rw-r--r-- | python/examples/logout.py | 18 | ||||
| -rw-r--r-- | python/lasso.py | 7 |
2 files changed, 18 insertions, 7 deletions
diff --git a/python/examples/logout.py b/python/examples/logout.py index 6dcbecce..789a1e90 100644 --- a/python/examples/logout.py +++ b/python/examples/logout.py @@ -31,6 +31,10 @@ splogout.destroy() print 'request url : ', msg_url print 'request body : ', msg_body +request_type = lasso.get_request_type_from_soap_msg(msg_body) +if request_type==lasso.RequestTypeLogout: + print "it's a LogoutRequest !" + # LogoutResponse : idpserver = lasso.Server.new("../../examples/idp.xml", @@ -42,15 +46,15 @@ idpuser_dump = "<LassoUser><LassoAssertions></LassoAssertions><LassoIdentities>< idpuser = lasso.User.new_from_dump(idpuser_dump) idplogout = lasso.Logout.new(idpserver, idpuser, lasso.providerTypeIdp) -#idplogout.process_request_msg(request_msg, lasso.httpMethodSoap) -#idplogout.build_response_msg() +idplogout.process_request_msg(request_msg, lasso.httpMethodSoap) +idplogout.build_response_msg() -#msg_url = idplogout.msg_url -#msg_body = idplogout.msg_body -#print 'body : ', idplogout.msg_body +msg_url = idplogout.msg_url +msg_body = idplogout.msg_body +print 'body : ', idplogout.msg_body # process the response : -#splogout = lasso.Logout.new(spserver, spuser, lasso.providerTypeSp) -#splogout.process_response_msg(msg_body, lasso.httpMethodSoap) +splogout = lasso.Logout.new(spserver, spuser, lasso.providerTypeSp) +splogout.process_response_msg(msg_body, lasso.httpMethodSoap) lasso.shutdown() diff --git a/python/lasso.py b/python/lasso.py index b61a0d96..5bbebda8 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -47,6 +47,13 @@ def shutdown(): """ return lassomod.shutdown() +# request types : +RequestTypeLogin = 1 +RequestTypeLogout = 2 +RequestTypeFederationTermination = 3 +RequestRegisterNameIdentifier = 4 +RequestTypeNameIdentifierMapping = 5 + def get_request_type_from_soap_msg(soap_buffer): return lassomod.profile_context_get_request_type_from_soap_msg(soap_buffer); |
