You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(app): dynamic authentication provider support (#2167)
This change adds support for loading authentication providers or modules
from dynamic plugins via 3 main changes to the code.
First, an environment variable `ENABLE_AUTH_PROVIDER_MODULE_OVERRIDE`
controls whether or not the backend installs the default authentication
provider module. When this override is enabled dynamic plugins can be
used to supply custom authentication providers.
Secondly this change also adds a `signInPage` configuration for frontend
dynamic plugins which is required for dynamic plugins to be able to
provide a custom SignInPage component, for example:
```yaml
dynamicPlugins:
frontend:
my-plugin-package:
signInPage:
importName: CustomSignInPage
```
Where the named export `CustomSignInPage` will be mapped to
`components.SignInPage` when the frontend is initialized.
Finally, to ensure authentication providers can be managed by the user a
new `providerSettings` configuration field is available for frontend
dynamic plugins, which can be used to inform the user settings page of
the new provider, for example:
```yaml
dynamicPlugins:
frontend:
my-plugin-package:
providerSettings:
- title: Github Two
description: Sign in with GitHub Org Two
provider: core.auth.github-two
```
Each `providerSettings` item will be turned into a new row under the
"Authentication Providers" tab on the user settings page. The
`provider` field is used to look up and connect the API ref for the
external authentication provider and should be the same string used when
calling `createApiRef`, for example:
```javascript
export const ghTwoAuthApiRef: ApiRef<
OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi
> = createApiRef({
id: 'core.auth.github-two', // <--- this string
})
```
This commit also updates the app config.d.ts with some missing
definitions as well as adds definitions for the above.
Signed-off-by: Stan Lewis <[email protected]>
0 commit comments