rename comparisonType to RACComparison

- 'comparisonType' is too generic.
 - Also, document in the main README.
This commit is contained in:
Mark Stosberg
2019-03-26 14:28:52 -04:00
parent a4661393f4
commit 48ac6558ef
4 changed files with 12 additions and 10 deletions
+2
View File
@@ -123,6 +123,8 @@ type Profile = {
* `attributeConsumingServiceIndex`: optional `AttributeConsumingServiceIndex` attribute to add to AuthnRequest to instruct the IDP which attribute set to attach to the response ([link](http://blog.aniljohn.com/2014/01/data-minimization-front-channel-saml-attribute-requests.html))
* `disableRequestedAuthnContext`: if truthy, do not request a specific authentication context. This is [known to help when authenticating against Active Directory](https://github.com/bergie/passport-saml/issues/226) (AD FS) servers.
* `authnContext`: if truthy, name identifier format to request auth context (default: `urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport`); array of values is also supported
* RACComparison: Requested Authentication Context comparison type. Possible values are 'exact','minimum','maximum','better'. Default is 'exact'.
* `forceAuthn`: if set to true, the initial SAML request from the service provider specifies that the IdP should force re-authentication of the user, even if they possess a valid session.
* `providerName`: optional human-readable name of the requester for use by the presenter's user agent or the identity provider
* `skipRequestCompression`: if set to true, the SAML request from the service provider won't be compressed.
+1 -1
View File
@@ -57,7 +57,7 @@ passport.use(new SamlStrategy(
identifierFormat: null,
// this is configured under the Advanced tab in AD FS relying party
signatureAlgorithm: 'sha256',
comparisonType: 'exact', // default to exact RequestedAuthnContext Comparison Type
RACComparison: 'exact', // default to exact RequestedAuthnContext Comparison Type
},
function(profile, done) {
return done(null,
+3 -3
View File
@@ -87,8 +87,8 @@ SAML.prototype.initialize = function (options) {
* - maximum: Assertion context must be no stronger than a context in the list
* - better: Assertion context must be stronger than all contexts in the list
*/
if (!options.comparisonType || ['exact','minimum','maximum','better'].indexOf(options.comparisonType) === -1){
options.comparisonType = 'exact';
if (!options.RACComparison || ['exact','minimum','maximum','better'].indexOf(options.RACComparison) === -1){
options.RACComparison = 'exact';
}
return options;
@@ -213,7 +213,7 @@ SAML.prototype.generateAuthorizeRequest = function (req, isPassive, callback) {
request['samlp:AuthnRequest']['samlp:RequestedAuthnContext'] = {
'@xmlns:samlp': 'urn:oasis:names:tc:SAML:2.0:protocol',
'@Comparison': self.options.comparisonType,
'@Comparison': self.options.RACComparison,
'saml:AuthnContextClassRef': authnContextClassRefs
};
}
+6 -6
View File
@@ -1406,14 +1406,14 @@ describe( 'passport-saml /', function() {
done();
});
it('should check the value of the option `comparisonType`', function(done) {
var samlObjBadComparisonType = new SAML({ comparisonType: 'bad_value' });
should.equal(samlObjBadComparisonType.options.comparisonType, 'exact', ['the default value of the option `comparisonType` must be exact']);
it('should check the value of the option `RACComparison`', function(done) {
var samlObjBadComparisonType = new SAML({ RACComparison: 'bad_value' });
should.equal(samlObjBadComparisonType.options.RACComparison, 'exact', ['the default value of the option `RACComparison` must be exact']);
var validComparisonTypes = ['exact','minimum','maximum','better'], samlObjValidComparisonType;
validComparisonTypes.forEach(function(comparisonType) {
samlObjValidComparisonType = new SAML( {comparisonType: comparisonType} );
should.equal(samlObjValidComparisonType.options.comparisonType, comparisonType);
validComparisonTypes.forEach(function(RACComparison) {
samlObjValidComparisonType = new SAML( {RACComparison: RACComparison} );
should.equal(samlObjValidComparisonType.options.RACComparison, RACComparison);
});
done();
});