diff --git a/.changeset/fresh-crews-impress.md b/.changeset/fresh-crews-impress.md new file mode 100644 index 0000000000..18f98f1dd9 --- /dev/null +++ b/.changeset/fresh-crews-impress.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-app-api': patch +--- + +Move the JWKS registration outside of the lifecycle middleware diff --git a/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts b/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts index 60c6dcd3c0..5e3a26252f 100644 --- a/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts +++ b/packages/backend-app-api/src/services/implementations/httpRouter/httpRouterServiceFactory.ts @@ -75,8 +75,8 @@ export const httpRouterServiceFactory = createServiceFactory( config, }); - router.use(createLifecycleMiddleware({ lifecycle })); router.use(createAuthIntegrationRouter({ auth })); + router.use(createLifecycleMiddleware({ lifecycle })); router.use(credentialsBarrier.middleware); router.use(createCookieAuthRefreshMiddleware({ auth, httpAuth }));