* @param resp Corresponding HttpServletResponse
*/
private void handleSingleLogoutRequest(HttpServletRequest req, HttpServletResponse resp) {
String logoutReqStr = decodeHTMLCharacters(req.getParameter(
SAML2SSOAuthenticatorConstants.HTTP_POST_PARAM_SAML2_AUTH_REQ));
CarbonSSOSessionManager ssoSessionManager = null;
XMLObject samlObject = null;
try {
ssoSessionManager = SAML2SSOAuthFEDataHolder.getInstance().getCarbonSSOSessionManager();
samlObject = Util.unmarshall(logoutReqStr);
} catch (SAML2SSOUIAuthenticatorException e) {
log.error("Error handling the single logout request", e);
}
if (samlObject instanceof LogoutRequest) {
LogoutRequest logoutRequest = (LogoutRequest) samlObject;
// There can be only one session index entry.
List<SessionIndex> sessionIndexList = logoutRequest.getSessionIndexes();
if (sessionIndexList.size() > 0) {
// mark this session as invalid.
ssoSessionManager.makeSessionInvalid(sessionIndexList.get(0).getSessionIndex());
}
}
}