add guest installation instructions

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-03-25 10:01:03 +01:00
parent 177a41a2ee
commit 4cc827965e
2 changed files with 43 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend-module-guest-provider': patch
---
Add installation instructions
@@ -2,6 +2,44 @@
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.
## Installation
First add the package itself to your backend dependencies:
```bash
# From your Backstage root directory
yarn --cwd packages/backend add @backstage/plugin-auth-backend-module-guest-provider
```
Then import it into your backend
```ts
// In packages/backend/src/index.ts
const backend = createBackend();
backend.add(import('@backstage/plugin-auth-backend-module-guest-provider'));
```
> [!TIP]
> 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:
```yaml
# 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:
- The user is signed in as a user with the ref `user:development/guest`
- The user only claims ownership through that ref
- The sign in will only work in development mode; if you try to enable it in production it will refuse to sign you in for security reasons.
See [the config schema](https://github.com/backstage/backstage/blob/master/plugins/auth-backend-module-guest-provider/config.d.ts) 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.
## Links
- [Backstage](https://backstage.io)