Merge pull request #5146 from GastonMeghi/fix-oidc-when-no-discovery

add oidc options from config if they exist
This commit is contained in:
Ylian Saint-Hilaire 2023-05-25 10:15:49 -07:00 committed by GitHub
commit 7087504841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;