mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
fix: requete http cause error
This commit is contained in:
parent
d159a4ef23
commit
d62596abcc
1 changed files with 11 additions and 2 deletions
|
|
@ -4,10 +4,19 @@ const config = require('../config');
|
|||
let oidcConfig = null;
|
||||
|
||||
async function initOidc() {
|
||||
const issuerUrl = new URL(config.authentikIssuerUrl);
|
||||
// Talking to Authentik over its internal Docker hostname (http://) rather
|
||||
// than its public HTTPS URL is expected (avoids a round trip through
|
||||
// Traefik) — openid-client refuses plain HTTP by default, so opt back in
|
||||
// for that case. The flag persists on the resulting Configuration for all
|
||||
// later calls (token exchange, etc.), not just discovery.
|
||||
const options = issuerUrl.protocol === 'http:' ? { execute: [client.allowInsecureRequests] } : undefined;
|
||||
oidcConfig = await client.discovery(
|
||||
new URL(config.authentikIssuerUrl),
|
||||
issuerUrl,
|
||||
config.oidcClientId,
|
||||
config.oidcClientSecret
|
||||
config.oidcClientSecret,
|
||||
undefined,
|
||||
options
|
||||
);
|
||||
return oidcConfig;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue