Fixed SAML issuer problem.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-25 00:09:35 -07:00
parent 137e9cd2ed
commit 37e52696d9
2 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@ module.exports.pluginHandler = function (parent) {
obj.refreshJS = function (req, res) { obj.refreshJS = function (req, res) {
// to minimize server reboots when installing new plugins, we call the new data and overwrite the old pluginHandler on the front end // to minimize server reboots when installing new plugins, we call the new data and overwrite the old pluginHandler on the front end
res.set('Content-Type', 'text/javascript'); res.set('Content-Type', 'text/javascript');
res.send('pluginHandlerBuilder = ' + obj.prepExports() + "\r\n" + ' pluginHandler = new pluginHandlerBuilder(); pluginHandler.callHook("onWebUIStartupEnd");'); res.send('pluginHandlerBuilder = ' + obj.prepExports() + '\r\n' + ' pluginHandler = new pluginHandlerBuilder(); pluginHandler.callHook("onWebUIStartupEnd");');
} }
obj.callHook = function (hookName, ...args) { obj.callHook = function (hookName, ...args) {

View File

@ -4372,7 +4372,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
function (profile, done) { function (profile, done) {
parent.debug('web', 'SAML profile: ' + JSON.stringify(profile)); parent.debug('web', 'SAML profile: ' + JSON.stringify(profile));
if (typeof profile.nameID != 'string') { return done(); } if (typeof profile.nameID != 'string') { return done(); }
var user = { sid: '~' + profile.issuer + ':' + profile.nameID, name: profile.nameID, strategy: 'saml' }; 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.firstname == 'string') && (typeof profile.lastname == 'string')) { user.name = profile.firstname + ' ' + profile.lastname; }
if (typeof profile.email == 'string') { user.email = profile.email; } if (typeof profile.email == 'string') { user.email = profile.email; }
return done(null, user); return done(null, user);