Skip to content

Commit 6f0876e

Browse files
ahavrilukmarkstos
authored andcommitted
NameIDFormat fix (#375)
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
1 parent 5cdf341 commit 6f0876e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/passport-saml/saml.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,10 @@ SAML.prototype.generateServiceProviderMetadata = function( decryptionCert, signi
12491249
};
12501250
}
12511251

1252-
metadata.EntityDescriptor.SPSSODescriptor.NameIDFormat = this.options.identifierFormat;
1252+
if (this.options.identifierFormat) {
1253+
metadata.EntityDescriptor.SPSSODescriptor.NameIDFormat = this.options.identifierFormat;
1254+
}
1255+
12531256
metadata.EntityDescriptor.SPSSODescriptor.AssertionConsumerService = {
12541257
'@index': '1',
12551258
'@isDefault': 'true',

0 commit comments

Comments
 (0)