diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-08-14 10:39:34 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-08-14 10:39:34 +0000 |
| commit | 93d5911a373e5955fee0348cfe9ba2ed78836162 (patch) | |
| tree | 54854bedb2ec9bdb92d41eb7ed0661fb512da4e4 | |
| parent | f05a03a102e4f09ac63e7fbe1f337e963064ac53 (diff) | |
counter providers that do not support any single logout; they are now skipped
and a correct response is nevertheless sent to the originating provider
| -rw-r--r-- | lasso/id-ff/logout.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c index 8ba11bf1..71f684c0 100644 --- a/lasso/id-ff/logout.c +++ b/lasso/id-ff/logout.c @@ -361,30 +361,48 @@ lasso_logout_init_request(LassoLogout *logout, char *remote_providerID, return critical_error(LASSO_SERVER_ERROR_PROVIDER_NOT_FOUND); } - /* before setting profile->request, verify if it is already set */ - if (LASSO_IS_LIB_LOGOUT_REQUEST(profile->request) == TRUE) { - lasso_node_destroy(LASSO_NODE(profile->request)); - profile->request = NULL; - } - - /* build a new request object from single logout protocol profile */ - /* get / verify http method */ if (http_method == LASSO_HTTP_METHOD_ANY) { http_method = lasso_provider_get_first_http_method( LASSO_PROVIDER(profile->server), remote_provider, LASSO_MD_PROTOCOL_TYPE_SINGLE_LOGOUT); + /* XXX: check it found a valid http method */ } else { if (lasso_provider_accept_http_method(LASSO_PROVIDER(profile->server), remote_provider, LASSO_MD_PROTOCOL_TYPE_SINGLE_LOGOUT, http_method, TRUE) == FALSE) { + if (http_method == LASSO_HTTP_METHOD_REDIRECT) { + /* it was probably used as last resort, and + * failed, since the remote provider doesn't + * support any logout. remove assertion + * unconditionnaly. */ + lasso_session_remove_assertion(profile->session, + profile->remote_providerID); + if (logout->initial_remote_providerID && logout->initial_request) { + g_free(profile->remote_providerID); + profile->remote_providerID = g_strdup( + logout->initial_remote_providerID); + profile->response = lasso_lib_logout_response_new_full( + LASSO_PROVIDER(profile->server)->ProviderID, + LASSO_SAML_STATUS_CODE_SUCCESS, + LASSO_LIB_LOGOUT_REQUEST(logout->initial_request), + LASSO_SIGNATURE_TYPE_NONE, + 0); + } + } return LASSO_PROFILE_ERROR_UNSUPPORTED_PROFILE; } } + /* before setting profile->request, verify it is not already set */ + if (LASSO_IS_LIB_LOGOUT_REQUEST(profile->request) == TRUE) { + lasso_node_destroy(LASSO_NODE(profile->request)); + profile->request = NULL; + } + /* build a new request object from http method */ if (http_method == LASSO_HTTP_METHOD_SOAP) { profile->request = lasso_lib_logout_request_new_full( |
