diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-11 03:09:12 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-11 03:09:12 +0000 |
| commit | 210693c46dc8de2faf0e26c04a45e64a1e0b26bb (patch) | |
| tree | 1961d5b407c6b85bec4da3ed1c857a03ebdb717d /python | |
| parent | e1580d4b512b7fdbaed988e50b8069b66ff688d5 (diff) | |
| download | lasso-210693c46dc8de2faf0e26c04a45e64a1e0b26bb.tar.gz lasso-210693c46dc8de2faf0e26c04a45e64a1e0b26bb.tar.xz lasso-210693c46dc8de2faf0e26c04a45e64a1e0b26bb.zip | |
*** empty log message ***
Diffstat (limited to 'python')
| -rw-r--r-- | python/environs/py_login.c | 22 | ||||
| -rw-r--r-- | python/environs/py_login.h | 1 | ||||
| -rw-r--r-- | python/examples/login.py | 16 | ||||
| -rw-r--r-- | python/lasso.py | 3 | ||||
| -rw-r--r-- | python/lassomod.c | 1 |
5 files changed, 42 insertions, 1 deletions
diff --git a/python/environs/py_login.c b/python/environs/py_login.c index f0dbee5a..6d2882c0 100644 --- a/python/environs/py_login.c +++ b/python/environs/py_login.c @@ -57,7 +57,7 @@ PyObject *login_getattr(PyObject *self, PyObject *args) { if (!strcmp(attr, "__members__")) return Py_BuildValue("[ssssss]", "request", "response", "request_type", - "msg_url", "msg_body", "protocolProfile"); + "msg_url", "msg_body", "protocolProfile", "assertionArtifact"); if (!strcmp(attr, "request")) return (LassoNode_wrap(LASSO_PROFILE_CONTEXT(login)->request)); if (!strcmp(attr, "response")) @@ -70,6 +70,8 @@ PyObject *login_getattr(PyObject *self, PyObject *args) { return (charPtrConst_wrap(LASSO_PROFILE_CONTEXT(login)->msg_body)); if (!strcmp(attr, "protocolProfile")) return (int_wrap(login->protocolProfile)); + if (!strcmp(attr, "assertionArtifact")) + return (charPtrConst_wrap(login->assertionArtifact)); Py_INCREF(Py_None); return (Py_None); @@ -179,6 +181,24 @@ PyObject *login_build_request_msg(PyObject *self, PyObject *args) { return (int_wrap(ret)); } +PyObject *login_handle_request_msg(PyObject *self, PyObject *args) { + PyObject *login_obj; + gchar *request_msg; + gboolean ret; + + if (CheckArgs(args, "OS:login_handle_request_msg")) { + if(!PyArg_ParseTuple(args, (char *) "Os:login_handle_request_msg", + &login_obj, &request_msg)) + return NULL; + } + else return NULL; + + ret = lasso_login_handle_request_msg(LassoLogin_get(login_obj), + request_msg); + + return (int_wrap(ret)); +} + PyObject *login_init_authn_request(PyObject *self, PyObject *args) { PyObject *login_obj; gchar *remote_providerID; diff --git a/python/environs/py_login.h b/python/environs/py_login.h index 7b8b4e2d..8fed53ae 100644 --- a/python/environs/py_login.h +++ b/python/environs/py_login.h @@ -45,6 +45,7 @@ PyObject *login_new_from_dump(PyObject *self, PyObject *args); PyObject *login_build_artifact_msg(PyObject *self, PyObject *args); PyObject *login_build_authn_request_msg(PyObject *self, PyObject *args); PyObject *login_build_request_msg(PyObject *self, PyObject *args); +PyObject *login_handle_request_msg(PyObject *self, PyObject *args); PyObject *login_init_authn_request(PyObject *self, PyObject *args); PyObject *login_init_from_authn_request_msg(PyObject *self, PyObject *args); PyObject *login_init_request(PyObject *self, PyObject *args); diff --git a/python/examples/login.py b/python/examples/login.py index e12195d4..527ff4cc 100644 --- a/python/examples/login.py +++ b/python/examples/login.py @@ -82,3 +82,19 @@ ret = splogin.init_request(response_msg, ret = splogin.build_request_msg() print "ret = %d, msg_url = %s, msg_body = %s" % (ret, splogin.msg_url, splogin.msg_body) + +##################### +# Identity provider # +##################### +server = lasso.Server.new("../../examples/idp.xml", + None, "../../examples/rsakey.pem", "../../examples/rootcert.pem", + lasso.SignatureMethodRsaSha1) + +server.add_provider("../../examples/sp.xml", + "../../examples/rsapub.pem", "../../examples/rsacert.pem") + +# create Response +idplogin = lasso.Login.new(server, None) + +ret = idplogin.handle_request_msg(splogin.msg_body) +print "samlp:AssertionArtifact = %s" % idplogin.assertionArtifact diff --git a/python/lasso.py b/python/lasso.py index 009bb867..8f6df7c1 100644 --- a/python/lasso.py +++ b/python/lasso.py @@ -874,6 +874,9 @@ class Login: def build_request_msg(self): return lassomod.login_build_request_msg(self) + def handle_request_msg(self, request_msg): + return lassomod.login_handle_request_msg(self, request_msg) + def init_authn_request(self, remote_providerID): return lassomod.login_init_authn_request(self, remote_providerID) diff --git a/python/lassomod.c b/python/lassomod.c index c17a8edc..846e07e3 100644 --- a/python/lassomod.c +++ b/python/lassomod.c @@ -208,6 +208,7 @@ static PyMethodDef lasso_methods[] = { {"login_build_artifact_msg", login_build_artifact_msg, METH_VARARGS}, {"login_build_authn_request_msg", login_build_authn_request_msg, METH_VARARGS}, {"login_build_request_msg", login_build_request_msg, METH_VARARGS}, + {"login_handle_request_msg", login_handle_request_msg, METH_VARARGS}, {"login_init_authn_request", login_init_authn_request, METH_VARARGS}, {"login_init_from_authn_request_msg", login_init_from_authn_request_msg, METH_VARARGS}, {"login_init_request", login_init_request, METH_VARARGS}, |
