Skip to content

Commit

Permalink
Added displayname handling to SAML strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Антон Мороз committed Nov 6, 2022
1 parent 40e19f0 commit c1b5929
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -7157,7 +7157,11 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
parent.debug('authlog', 'SAML profile: ' + JSON.stringify(profile, null, 4));
if (typeof profile.nameID != 'string') { return done(); }
var user = { sid: '~saml:' + profile.nameID, name: profile.nameID, strategy: 'saml' };
if ((typeof profile.firstname == 'string') && (typeof profile.lastname == 'string')) { user.name = profile.firstname + ' ' + profile.lastname; }
if (typeof profile.displayname == 'string') {
user.name = profile.displayname;
} else if ((typeof profile.firstname == 'string') && (typeof profile.lastname == 'string')) {
user.name = profile.firstname + ' ' + profile.lastname;
}
if (typeof profile.email == 'string') { user.email = profile.email; }
return done(null, user);
}
Expand Down

0 comments on commit c1b5929

Please sign in to comment.