Fixing the problem of common log out

revert-70aa11f8
Megala 8 years ago
parent b10c323582
commit e5870e1306

@ -486,14 +486,11 @@ var module = {};
*/ */
module.ssoAcs = function (request, response) { module.ssoAcs = function (request, response) {
var samlResponse = request.getParameter("SAMLResponse"); var samlResponse = request.getParameter("SAMLResponse");
if (!samlResponse) { var samlRequest = request.getParameter('SAMLRequest');
var msg = "SAML response is not found in request parameters.";
log.error(msg);
response.sendError(400, msg);
return;
}
var ssoClient = require("sso").client; var ssoClient = require("sso").client;
var samlResponseObj; var samlResponseObj;
if (samlResponse) {
try { try {
samlResponseObj = ssoClient.getSamlObject(samlResponse); samlResponseObj = ssoClient.getSamlObject(samlResponse);
} catch (e) { } catch (e) {
@ -548,6 +545,16 @@ var module = {};
response.sendError(500, msg); response.sendError(500, msg);
} }
} }
}
if (samlRequest) {
var index = ssoClient.decodeSAMLLogoutRequest(ssoClient.getSamlObject(samlRequest));
if (log.isDebugEnabled()) {
log.debug("Back end log out request received for the session Id : " + index);
}
var jSessionId = getSsoSessions()[index];
delete getSsoSessions()[index];
session.invalidate();
}
}; };
/** /**

Loading…
Cancel
Save