summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-07-21 10:08:32 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-07-21 10:08:32 +0000
commitddf6dd5516e6dbf778968c7fd97ba094c115d36b (patch)
treea4c4aab755f0ae1924f2978bbf24d6785151bd28
parent470e21d4d250216afa07979423f137f1cd65987d (diff)
downloadlasso-ddf6dd5516e6dbf778968c7fd97ba094c115d36b.tar.gz
lasso-ddf6dd5516e6dbf778968c7fd97ba094c115d36b.tar.xz
lasso-ddf6dd5516e6dbf778968c7fd97ba094c115d36b.zip
allow no param in init_request for class Logout
-rw-r--r--lasso/id-ff/logout.c17
-rw-r--r--python/environs/py_logout.c2
-rw-r--r--python/lasso.py2
3 files changed, 12 insertions, 9 deletions
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c
index 68ef5c65..9cee792f 100644
--- a/lasso/id-ff/logout.c
+++ b/lasso/id-ff/logout.c
@@ -52,13 +52,13 @@ lasso_logout_build_request_msg(LassoLogout *logout)
profileContext = LASSO_PROFILE_CONTEXT(logout);
- /* get the prototocol profile of the logout */
provider = lasso_server_get_provider(profileContext->server, profileContext->remote_providerID);
if(provider==NULL){
debug(ERROR, "Provider %s not found\n", profileContext->remote_providerID);
return(-2);
}
+ /* get the prototocol profile of the logout request */
singleLogoutServiceURL = lasso_provider_get_singleLogoutServiceURL(provider);
protocolProfile = lasso_provider_get_singleLogoutProtocolProfile(provider);
@@ -159,19 +159,23 @@ lasso_logout_init_request(LassoLogout *logout,
xmlChar *content, *nameQualifier, *format;
g_return_val_if_fail(LASSO_IS_LOGOUT(logout), -1);
- g_return_val_if_fail(remote_providerID!=NULL, -2);
profileContext = LASSO_PROFILE_CONTEXT(logout);
if(remote_providerID==NULL){
- debug(INFO, "No remote provider id, get the issuer of the first authentication assertion\n");
+ debug(INFO, "No remote provider id, get the next assertion peer provider id\n");
profileContext->remote_providerID = lasso_user_get_next_providerID(profileContext->user);
}
else{
- debug(INFO, "A remote provider id : %s\n", remote_providerID);
+ debug(INFO, "A remote provider id for logout request : %s\n", remote_providerID);
profileContext->remote_providerID = g_strdup(remote_providerID);
}
+ if(profileContext->remote_providerID==NULL){
+ debug(ERROR, "No provider id for init request\n");
+ return(-2);
+ }
+
/* get identity */
identity = lasso_user_get_identity(profileContext->user, profileContext->remote_providerID);
if(identity==NULL){
@@ -187,7 +191,6 @@ lasso_logout_init_request(LassoLogout *logout,
nameIdentifier = LASSO_NODE(lasso_identity_get_remote_nameIdentifier(identity));
break;
case lassoProviderTypeIdp:
- /* get the next assertion ( next authenticated service provider ) */
nameIdentifier = LASSO_NODE(lasso_identity_get_remote_nameIdentifier(identity));
if(!nameIdentifier)
nameIdentifier = LASSO_NODE(lasso_identity_get_local_nameIdentifier(identity));
@@ -198,10 +201,9 @@ lasso_logout_init_request(LassoLogout *logout,
}
if(!nameIdentifier){
- debug(ERROR, "Name identifier not found\n");
+ debug(ERROR, "Name identifier not found for %s\n", profileContext->remote_providerID);
return(-5);
}
- debug(DEBUG, "Name identifier : %s\n", lasso_node_export(nameIdentifier));
/* build the request */
content = lasso_node_get_content(nameIdentifier);
@@ -364,6 +366,7 @@ lasso_logout_finalize(LassoLogout *logout)
static void
lasso_logout_instance_init(LassoLogout *logout)
{
+
}
static void
diff --git a/python/environs/py_logout.c b/python/environs/py_logout.c
index 1333e40f..68904059 100644
--- a/python/environs/py_logout.c
+++ b/python/environs/py_logout.c
@@ -144,7 +144,7 @@ PyObject *logout_init_request(PyObject *self, PyObject *args) {
gint codeError;
if (CheckArgs(args, "Os:logout_init_request")) {
- if(!PyArg_ParseTuple(args, (char *) "O|s:logout_init_request",
+ if(!PyArg_ParseTuple(args, (char *) "Oz:logout_init_request",
&logout_obj, &remote_providerID))
return NULL;
}
diff --git a/python/lasso.py b/python/lasso.py
index 6b2ac265..dd8690c9 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -1056,7 +1056,7 @@ class FederationTermination:
def destroy(self):
pass
- def init_notification(self, remote_providerID):
+ def init_notification(self, remote_providerID = None):
return lassomod.federation_termination_init_notification(self, remote_providerID);
def process_notification_msg(self, notification_msg, notification_method):