From 0b6ba85c75e66db1b3bf76e1eee260bd3ba53cd3 Mon Sep 17 00:00:00 2001 From: Min Kim Date: Wed, 20 Dec 2023 09:38:17 -0500 Subject: [PATCH] Write documentation for using auth in new backend Signed-off-by: Min Kim --- .../building-backends/08-migrating.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/backend-system/building-backends/08-migrating.md b/docs/backend-system/building-backends/08-migrating.md index 27e4eb7324..e8cebf4eb9 100644 --- a/docs/backend-system/building-backends/08-migrating.md +++ b/docs/backend-system/building-backends/08-migrating.md @@ -1042,3 +1042,24 @@ backend.add(import('@backstage/plugin-auth-backend')); backend.add(authModuleGoogleProvider); /* highlight-add-end */ ``` + +#### Using Legacy Providers + +Not all authentication providers have been refactored to support the new backend system. If your authentication provider module is not available yet, you will need to import your backend auth plugin using the legacy helper: + +```ts title="packages/backend/src/index.ts" +import { createBackend } from '@backstage/backend-defaults'; +/* highlight-add-next-line */ +import { legacyPlugin } from '@backstage/backend-common'; +import { coreServices } from '@backstage/backend-plugin-api'; + +const backend = createBackend(); +/* highlight-remove-next-line */ +backend.add(import('@backstage/plugin-auth-backend')); +/* highlight-add-next-line */ +backend.add(legacyPlugin('auth'), import('./plugins/auth')); + +backend.start(); +``` + +> You can track the progress of the module migration efforts [here](https://github.com/backstage/backstage/issues/19476).