mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-26 07:57:56 +03:00
Added displayname handling to SAML strategy
This commit is contained in:
parent
40e19f0764
commit
c1b59294cf
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user