X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=shibsp%2Fhandler%2Fimpl%2FSAML2Logout.cpp;h=d6931ceaca0b4b7412b768c9f230260e895d48d9;hb=2b8daf0f4fd3e5035ab3babdc76fe676e8823f93;hp=9a2e71a3af3e93be2d7245f3c942b0c912979acf;hpb=a5b1914f888d2ac8992cc4985d65e9d727aa8df4;p=shibboleth%2Fsp.git diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp index 9a2e71a..d6931ce 100644 --- a/shibsp/handler/impl/SAML2Logout.cpp +++ b/shibsp/handler/impl/SAML2Logout.cpp @@ -24,6 +24,7 @@ #include "exceptions.h" #include "Application.h" #include "ServiceProvider.h" +#include "SPRequest.h" #include "handler/AbstractHandler.h" #include "handler/LogoutHandler.h" #include "util/SPConstants.h" @@ -34,9 +35,11 @@ # include "metadata/MetadataProviderCriteria.h" # include "util/TemplateParameters.h" # include +# include # include # include # include +# include # include # include using namespace opensaml::saml2; @@ -531,11 +534,18 @@ pair SAML2Logout::doRequest(const Application& application, const HTT // If relay state is set, recover the original return URL. if (!relayState.empty()) recoverRelayState(application, request, response, relayState); + + // Check for partial logout. + const StatusCode* sc = logoutResponse->getStatus() ? logoutResponse->getStatus()->getStatusCode() : NULL; + sc = sc ? sc->getStatusCode() : NULL; + if (sc && XMLString::equals(sc->getValue(), StatusCode::PARTIAL_LOGOUT)) + return sendLogoutPage(application, request, response, "partial"); + if (!relayState.empty()) return make_pair(true, response.sendRedirect(relayState.c_str())); - // Return template for completion of global logout, or redirect to homeURL. - return sendLogoutPage(application, request, response, false, "Global logout completed."); + // Return template for completion of logout. + return sendLogoutPage(application, request, response, "global"); } FatalProfileException ex("Incoming message was not a samlp:LogoutRequest or samlp:LogoutResponse.");