diff --git a/packages/core/src/oidc/init.ts b/packages/core/src/oidc/init.ts index f174cf656..396886764 100644 --- a/packages/core/src/oidc/init.ts +++ b/packages/core/src/oidc/init.ts @@ -132,6 +132,16 @@ export default async function initOidc(app: Koa): Promise { return refreshTokenTtl ?? defaultRefreshTokenTtl; }, + AccessToken: (ctx, token) => { + if (token.resourceServer) { + return token.resourceServer.accessTokenTTL ?? 60 * 60; // 1 hour in seconds + } + + return 60 * 60; // 1 hour in seconds + }, + Interaction: 3600 /* 1 hour in seconds */, + Session: 1_209_600 /* 14 days in seconds */, + Grant: 1_209_600 /* 14 days in seconds */, }, extraTokenClaims: async (_ctx, token) => { // AccessToken type is not exported by default, need to asset token is AccessToken