@parodos/plugin-parodos-auth
v0.1.0
Published
> Login page.
Downloads
1
Keywords
Readme
parodos-auth
Login page.
This plugin is meant to be used in pair with:
Warning
This plugin is currently only for demonstration purposes until proper backend authentication is implemented.
Installation
# From your Backstage root directory
yarn add --cwd packages/app @parodos/plugin-parodos-auth
Configuration
In the App.tsx
file, change the createApp
function adding a components
with our custom ParodosSignInPage
packages/app/src/App.tsx
import { ParodosSignInPage } from '@parodos/plugin-parodos-auth';
const app = createApp({
// ...
components: {
SignInPage: ParodosSignInPage,
},
// ...
});
apis.ts
The parodos backend currently requires basic authentication.
To enable both basic auth and use the backstage proxy, the following configuration needs added to ./packages/app/src/apis.ts
createApiFactory({
api: fetchApiRef,
deps: {
configApi: configApiRef,
identityApi: identityApiRef,
discoveryApi: discoveryApiRef,
},
factory: ({ configApi, identityApi, discoveryApi }) => {
return createFetchApi({
middleware: [
FetchMiddlewares.resolvePluginProtocol({
discoveryApi,
}),
FetchMiddlewares.injectIdentityAuth({
identityApi,
config: configApi,
header: {
name: 'Authorization',
value: token => `Basic ${token}`,
},
}),
],
});
},
}),
local development
A login of userName
: test and password
: test will successfully log you in.