Commit 80da2879 authored by Ashima Athri's avatar Ashima Athri
Browse files

Only add to logout xml if present in authn response

parent 90973fff
......@@ -208,13 +208,19 @@ SAML.prototype.generateLogoutRequest = function (req) {
},
'saml:NameID' : {
'@Format': req.user.nameIDFormat,
'@NameQualifier': req.user.nameQualifier,
'@SPNameQualifier': req.user.spNameQualifier,
'#text': req.user.nameID
}
}
};
if (typeof(req.user.nameQualifier) !== 'undefined') {
request['samlp:LogoutRequest']['saml:NameID']['@NameQualifier'] = req.user.nameQualifier;
}
if (typeof(req.user.spNameQualifier) !== 'undefined') {
request['samlp:LogoutRequest']['saml:NameID']['@SPNameQualifier'] = req.user.spNameQualifier;
}
if (req.user.sessionIndex) {
request['samlp:LogoutRequest']['saml2p:SessionIndex'] = {
'@xmlns:saml2p': 'urn:oasis:names:tc:SAML:2.0:protocol',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment