add oidc options from config if they exist

This commit is contained in:
Gaston Meghinasso 2023-05-21 22:18:53 -03:00
parent 3dd469f1a0
commit 181d4db0fe

View File

@ -7116,6 +7116,11 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
clientSecret: domain.authstrategies.oidc.clientsecret,
scope: ['profile', 'email'],
};
if (typeof domain.authstrategies.oidc.authorizationurl == 'string') {options.authorizationURL = domain.authstrategies.oidc.authorizationurl; }
if (typeof domain.authstrategies.oidc.tokenurl == 'string') { options.tokenURL = domain.authstrategies.oidc.tokenurl; }
if (typeof domain.authstrategies.oidc.userinfourl == 'string') { options.userInfoURL = domain.authstrategies.oidc.userinfourl; }
if (typeof domain.authstrategies.oidc.callbackurl == 'string') { options.callbackURL = domain.authstrategies.oidc.callbackurl; }
const discoverOptions = async function(options){
if ((typeof domain.authstrategies.oidc.authorizationurl != 'string') || (typeof domain.authstrategies.oidc.tokenurl != 'string') || (typeof domain.authstrategies.oidc.userinfourl != 'string')) {
const Issuer = require('openid-client').Issuer;