Skip to content

Commit

Permalink
⭐ feat: add RequestedAuthnContext Comparison Type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
osan15 committed Mar 5, 2019
1 parent b384277 commit cd80c99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/adfs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ passport.use(new SamlStrategy(
acceptedClockSkewMs: -1,
identifierFormat: null,
// this is configured under the Advanced tab in AD FS relying party
signatureAlgorithm: 'sha256'
signatureAlgorithm: 'sha256',
comparisonType: 'exact', // default to exact RequestedAuthnContext Comparison Type
},
function(profile, done) {
return done(null,
Expand Down
7 changes: 6 additions & 1 deletion lib/passport-saml/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ SAML.prototype.initialize = function (options) {
options.signatureAlgorithm = 'sha1';
}

// better, exact, minimum, maximum
if (!options.comparisonType){
options.comparisonType = 'exact';
}

return options;
};

Expand Down Expand Up @@ -202,7 +207,7 @@ SAML.prototype.generateAuthorizeRequest = function (req, isPassive, callback) {

request['samlp:AuthnRequest']['samlp:RequestedAuthnContext'] = {
'@xmlns:samlp': 'urn:oasis:names:tc:SAML:2.0:protocol',
'@Comparison': 'exact',
'@Comparison': self.options.comparisonType,
'saml:AuthnContextClassRef': authnContextClassRefs
};
}
Expand Down

0 comments on commit cd80c99

Please sign in to comment.