Skip to content

Commit

Permalink
Merge pull request #124 from ashimaathri/add_attributes_to_nameid
Browse files Browse the repository at this point in the history
Add NameQualifier and SPNameQualifier to nameID
  • Loading branch information
ploer committed Nov 10, 2015
2 parents 97a9488 + fadd3e4 commit 8fa3381
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/passport-saml/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ SAML.prototype.generateLogoutRequest = function (req) {
}
};

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',
Expand Down Expand Up @@ -598,6 +606,8 @@ SAML.prototype.processValidlySignedAssertion = function(xml, inResponseTo, callb

if (nameID[0].$ && nameID[0].$.Format) {
profile.nameIDFormat = nameID[0].$.Format;
profile.nameQualifier = nameID[0].$.NameQualifier;
profile.spNameQualifier = nameID[0].$.SPNameQualifier;
}
}
}
Expand Down
34 changes: 34 additions & 0 deletions test/tests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8fa3381

Please sign in to comment.