summaryrefslogtreecommitdiffstats
path: root/auth_mellon_handler.c
diff options
context:
space:
mode:
authorolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2007-09-28 14:07:44 +0000
committerolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2007-09-28 14:07:44 +0000
commit1ad86aae5505f41eabe94ad42cb69e268fc97504 (patch)
tree1bbe1407c2ce723a1d1c8d1f83d9aa29926e6fde /auth_mellon_handler.c
parentec25fac7821f9c447bf7077e78511de04272043a (diff)
downloadmod_auth_mellon-1ad86aae5505f41eabe94ad42cb69e268fc97504.tar.gz
mod_auth_mellon-1ad86aae5505f41eabe94ad42cb69e268fc97504.tar.xz
mod_auth_mellon-1ad86aae5505f41eabe94ad42cb69e268fc97504.zip
Skeleton for SP initiated logout.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@8 a716ebb1-153a-0410-b759-cfb97c6a1b53
Diffstat (limited to 'auth_mellon_handler.c')
-rw-r--r--auth_mellon_handler.c53
1 files changed, 47 insertions, 6 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
index 5e28c53..555af09 100644
--- a/auth_mellon_handler.c
+++ b/auth_mellon_handler.c
@@ -280,6 +280,47 @@ static int am_handle_logout_request(request_rec *r, LassoLogout *logout)
}
+/* This function handles a logout response message from the IdP. We get
+ * this message after we have sent a logout request to the IdP.
+ *
+ * Parameters:
+ * request_rec *r The logout response request.
+ * LassoLogout *logout A LassoLogout object initiated with
+ * the current session.
+ *
+ * Returns:
+ * OK on success, or an error if any of the steps fail.
+ */
+static int am_handle_logout_response(request_rec *r, LassoLogout *logout)
+{
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ "TODO: Handle logout response.");
+
+ lasso_logout_destroy(logout);
+ return HTTP_INTERNAL_SERVER_ERROR;
+}
+
+
+/* This function initiates a logout request and sends it to the IdP.
+ *
+ * Parameters:
+ * request_rec *r The logout response request.
+ * LassoLogout *logout A LassoLogout object initiated with
+ * the current session.
+ *
+ * Returns:
+ * OK on success, or an error if any of the steps fail.
+ */
+static int am_init_logout_request(request_rec *r, LassoLogout *logout)
+{
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ "TODO: Initiate logout request.");
+
+ lasso_logout_destroy(logout);
+ return HTTP_INTERNAL_SERVER_ERROR;
+}
+
+
/* This function handles requests to the logout handler.
*
* Parameters:
@@ -321,13 +362,13 @@ static int am_handle_logout(request_rec *r)
if(am_extract_query_parameter(r->pool, r->args, "SAMLRequest") != NULL) {
/* SAMLRequest - logout request from the IdP. */
return am_handle_logout_request(r, logout);
+ } else if(am_extract_query_parameter(r->pool, r->args, "SAMLResponse")
+ != NULL) {
+ /* SAMLResponse - logout response from the IdP. */
+ return am_handle_logout_response(r, logout);
} else {
- ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
- "TODO: handle SP-initiated logout.");
-
- lasso_logout_destroy(logout);
-
- return HTTP_INTERNAL_SERVER_ERROR;
+ /* Initiate logout request. */
+ return am_init_logout_request(r, logout);
}
}