X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Fhandler%2Fimpl%2FSAML2LogoutInitiator.cpp;h=ff813d3d6be7e90cbee084f3bf1fd11cad057355;hb=9be4b519723e188d5b4dc5c52ed39d5d1e377d41;hp=00a1a66457d287a9c97fad5336e4666f2cecdabb;hpb=109ccda928baa45021837cb59fd2aad960006941;p=shibboleth%2Fcpp-sp.git diff --git a/shibsp/handler/impl/SAML2LogoutInitiator.cpp b/shibsp/handler/impl/SAML2LogoutInitiator.cpp index 00a1a66..ff813d3 100644 --- a/shibsp/handler/impl/SAML2LogoutInitiator.cpp +++ b/shibsp/handler/impl/SAML2LogoutInitiator.cpp @@ -348,6 +348,11 @@ pair SAML2LogoutInitiator::doRequest( } else { delete logoutResponse; + const char* returnloc = httpRequest.getParameter("return"); + if (returnloc) { + ret.second = httpResponse.sendRedirect(returnloc); + ret.first = true; + } ret = sendLogoutPage(application, httpRequest, httpResponse, false, "Logout completed successfully."); } @@ -359,11 +364,19 @@ pair SAML2LogoutInitiator::doRequest( return ret; } + // Save off return location as RelayState. + string relayState; + const char* returnloc = httpRequest.getParameter("return"); + if (returnloc) { + relayState = returnloc; + preserveRelayState(application, httpResponse, relayState); + } + auto_ptr msg(buildRequest(application, *session, *role, encoder)); msg->setDestination(ep->getLocation()); auto_ptr_char dest(ep->getLocation()); - ret.second = sendMessage(*encoder, msg.get(), NULL, dest.get(), role, application, httpResponse); + ret.second = sendMessage(*encoder, msg.get(), relayState.c_str(), dest.get(), role, application, httpResponse); ret.first = true; msg.release(); // freed by encoder }