This module provides a guest auth provider implementation for @backstage/plugin-auth-backend. This is meant to supersede the existing 'guest' option for authentication that does not emit tokens and is completely stored as frontend state.
First add the package itself to your backend dependencies:
# From your Backstage root directory
yarn --cwd packages/backend add @backstage/plugin-auth-backend-module-guest-provider
Then import it into your backend
// In packages/backend/src/index.ts
const backend = createBackend();
backend.add(import('@backstage/plugin-auth-backend-module-guest-provider'));
If you happen to have enabled automatic feature discovery (which is very uncommon at the time of writing), you do not need to perform this step.
And finally make sure to enable it in your config:
# In app-config.yaml - NOT app-config.production.yaml
auth:
providers:
guest: {}
Notice the double curly braces, which correspond to an empty object. This sets everything up using the default settings, which are:
user:development/guestSee the config schema for details about the available options. If you add options to your app-config file under the guest key, remember to remove the double curly braces as well.
The guest-provider backend module for the auth plugin.