Skip to content

Commit

Permalink
NameIDFormat fix (#375)
Browse files Browse the repository at this point in the history
Added a conditional statement to set NameIDFormat only if identifierFormat is specified in options. This should prevent an error in AD FS when identifierFormat  set to null: #338
  • Loading branch information
ahavriluk authored and markstos committed Jul 26, 2019
1 parent 5cdf341 commit 6f0876e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/passport-saml/saml.js
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,10 @@ SAML.prototype.generateServiceProviderMetadata = function( decryptionCert, signi
};
}

metadata.EntityDescriptor.SPSSODescriptor.NameIDFormat = this.options.identifierFormat;
if (this.options.identifierFormat) {
metadata.EntityDescriptor.SPSSODescriptor.NameIDFormat = this.options.identifierFormat;
}

metadata.EntityDescriptor.SPSSODescriptor.AssertionConsumerService = {
'@index': '1',
'@isDefault': 'true',
Expand Down

0 comments on commit 6f0876e

Please sign in to comment.