packages/app: add oauth request and google auth APIs

This commit is contained in:
Patrik Oldsberg
2020-05-22 13:41:55 +02:00
parent 659e904f55
commit c1b76913a0
2 changed files with 20 additions and 1 deletions
+2 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createApp } from '@backstage/core';
import { createApp, OAuthRequestDialog } from '@backstage/core';
import React, { FC } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Root from './components/Root';
@@ -33,6 +33,7 @@ const AppComponent = app.getRootComponent();
const App: FC<{}> = () => (
<AppProvider>
<AlertDisplay forwarder={alertApiForwarder} />
<OAuthRequestDialog />
<Router>
<Root>
<AppComponent />
+18
View File
@@ -23,6 +23,10 @@ import {
ErrorApiForwarder,
featureFlagsApiRef,
FeatureFlags,
GoogleAuth,
oauthRequestApiRef,
OAuthRequestManager,
googleAuthApiRef,
} from '@backstage/core';
import {
@@ -46,6 +50,20 @@ builder.add(featureFlagsApiRef, new FeatureFlags());
builder.add(lighthouseApiRef, new LighthouseRestApi('http://localhost:3003'));
const oauthRequestApi = builder.add(
oauthRequestApiRef,
new OAuthRequestManager(),
);
builder.add(
googleAuthApiRef,
GoogleAuth.create({
apiOrigin: 'http://localhost:7000',
basePath: '/auth/',
oauthRequestApi,
}),
);
builder.add(
techRadarApiRef,
new TechRadar({