diff --git a/src/oidc.js b/src/oidc.js index 29ad10196..85fcd4419 100644 --- a/src/oidc.js +++ b/src/oidc.js @@ -106,7 +106,7 @@ class CloudronAdapter { debug(`[${this.name}] findByUid uid:${uid}`); for (let d in this.store) { - if (this.store[d].uid === uid) return this.store[d].payload; + if (this.store[d].payload.uid === uid) return this.store[d].payload; } return false; @@ -171,6 +171,14 @@ async function getProvider() { const { Provider } = await import('oidc-provider'); const configuration = { + async findAccount(ctx, id) { + debug(`findAccount ctx:${ctx} id:${id}`); + + return { + accountId: id, + async claims(use, scope) { return { sub: id }; }, + }; + }, adapter: CloudronAdapter, clients: [{ client_id: 'foo',