diff --git a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts b/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts index c380040b64..eaef7fb4bf 100644 --- a/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/auth/authServiceFactory.ts @@ -109,7 +109,6 @@ class DefaultAuthService implements AuthService { private readonly userTokenHandler: UserTokenHandler, private readonly pluginId: string, private readonly disableDefaultAuthPolicy: boolean, - private readonly databaseService: DatabaseService, private readonly pluginTokenHandler: PluginTokenHandler, ) {} @@ -235,7 +234,6 @@ class DefaultAuthService implements AuthService { export const authServiceFactory = createServiceFactory({ service: coreServices.auth, deps: { - database: coreServices.database, config: coreServices.rootConfig, logger: coreServices.rootLogger, discovery: coreServices.discovery, @@ -245,8 +243,16 @@ export const authServiceFactory = createServiceFactory({ // keeps working as long as there are plugins that have not been migrated to the // new auth services in the new backend system. tokenManager: coreServices.tokenManager, + publicKeyStore: coreServices.publicKeyStore, }, - async factory({ config, discovery, plugin, tokenManager, database }) { + async factory({ + config, + discovery, + plugin, + tokenManager, + logger, + publicKeyStore, + }) { const disableDefaultAuthPolicy = Boolean( config.getOptionalBoolean( 'backend.auth.dangerouslyDisableDefaultAuthPolicy', @@ -257,9 +263,12 @@ export const authServiceFactory = createServiceFactory({ new UserTokenHandler({ discovery }), plugin.getId(), disableDefaultAuthPolicy, - database, - // TODO(vinzscam): fixme - PluginTokenHandler.create(undefined!), + PluginTokenHandler.create({ + keyDurationSeconds: 60 * 60, + issuer: `plugin:${plugin.getId()}`, + logger, + publicKeyStore, + }), ); }, });