diff --git a/common/ASC.SsoAuth/app/routes.js b/common/ASC.SsoAuth/app/routes.js index 0b7b06a4a9b..0845f31ead7 100644 --- a/common/ASC.SsoAuth/app/routes.js +++ b/common/ASC.SsoAuth/app/routes.js @@ -289,6 +289,10 @@ module.exports = function (app, config) { return res.redirect(request.context); } } + function getValueByKeyIgnoreCase(obj, key) { + const entry = Object.entries(obj).find(([k]) => k.toLowerCase() === key.toLowerCase()); + return entry ? entry[1] : undefined; + } const createAuthnTemplateCallback = (_idp, _sp, method) => (template) => { const metadata = { idp: _idp.entityMeta, sp: _sp.entityMeta }; @@ -567,8 +571,8 @@ module.exports = function (app, config) { //const logoutUser = new LogoutModel(userData.NameId, userData.SessionId); const user = { - logoutNameID: userData.NameId, - sessionIndex: userData.SessionId, + logoutNameID: getValueByKeyIgnoreCase(userData, "NameId"), + sessionIndex: getValueByKeyIgnoreCase(userData, "SessionId") }; const data = sp.createLogoutRequest(