oidc: put clients into the db

This commit is contained in:
Johannes Zellner
2023-03-16 15:37:03 +01:00
parent da77b1ae5d
commit 4b7e4731a8
4 changed files with 130 additions and 46 deletions

View File

@@ -388,10 +388,6 @@ async function initializeExpressSync() {
app.use(oidcPrefix, oidcProvider.callback());
// FIXME this should come from the database
await oidc.upsertClient(oidcProvider, 'foo', 'bar', 'https://openidconnect.net/callback');
await oidc.upsertClient(oidcProvider, 'oidcdebugger', 'bar', 'https://oidcdebugger.com/debug');
// disable server socket "idle" timeout. we use the timeout middleware to handle timeouts on a route level
// we rely on nginx for timeouts on the TCP level (see client_header_timeout)
httpServer.setTimeout(0);
@@ -438,6 +434,8 @@ async function start() {
await util.promisify(gHttpServer.listen.bind(gHttpServer))(constants.PORT, '127.0.0.1');
await safe(eventlog.add(eventlog.ACTION_START, { userId: null, username: 'boot' }, { version: constants.VERSION })); // can fail if db down
try { await oidc.clients.add('foo', 'bar', 'https://openidconnect.net/callback'); } catch (e) { console.log('Client already exists', e); }
}
async function stop() {