Skip to content

Commit 19dfd42

Browse files
feat(lightspeed): Add GitHub Auth Provider for Sign-In to enable Models listing (#1987)
* adding github signin provider Signed-off-by: its-mitesh-kumar <[email protected]> * adding changeset Signed-off-by: its-mitesh-kumar <[email protected]> * removing changeset Signed-off-by: its-mitesh-kumar <[email protected]> * Update workspaces/lightspeed/app-config.yaml Co-authored-by: Debsmita Santra <[email protected]> --------- Signed-off-by: its-mitesh-kumar <[email protected]> Co-authored-by: Debsmita Santra <[email protected]>
1 parent 8524940 commit 19dfd42

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

workspaces/lightspeed/app-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,19 @@ techdocs:
6363

6464
auth:
6565
# see https://backstage.io/docs/auth/ to learn about auth providers
66+
environment: development
6667
providers:
6768
# See https://backstage.io/docs/auth/guest/provider
6869
guest: {}
70+
# Uncomment if using GitHub provider
71+
# See https://backstage.io/docs/auth/github/provider#configuration
72+
# github:
73+
# development:
74+
# clientId: ${AUTH_GITHUB_CLIENT_ID}
75+
# clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}
76+
# signIn:
77+
# resolvers:
78+
# - resolver: usernameMatchingUserEntityName
6979

7080
scaffolder: {}
7181
# see https://backstage.io/docs/features/software-templates/configuration for software template options

workspaces/lightspeed/packages/app/src/App.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ import { RequirePermission } from '@backstage/plugin-permission-react';
5353
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
5454
import { lightspeedTranslations } from '@red-hat-developer-hub/backstage-plugin-lightspeed/alpha';
5555
import { LightspeedPage } from '@red-hat-developer-hub/backstage-plugin-lightspeed';
56+
import { githubAuthApiRef } from '@backstage/core-plugin-api';
5657

58+
const githubProvider = {
59+
id: 'github-auth-provider',
60+
title: 'GitHub',
61+
message: 'Sign in using GitHub',
62+
apiRef: githubAuthApiRef,
63+
};
5764
const app = createApp({
5865
apis,
5966
__experimentalTranslations: {
@@ -78,7 +85,9 @@ const app = createApp({
7885
});
7986
},
8087
components: {
81-
SignInPage: props => <SignInPage {...props} auto providers={['guest']} />,
88+
SignInPage: props => (
89+
<SignInPage {...props} auto providers={['guest', githubProvider]} />
90+
),
8291
},
8392
});
8493

workspaces/lightspeed/packages/backend/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,7 @@ backend.add(
6262
import('@red-hat-developer-hub/backstage-plugin-lightspeed-backend'),
6363
);
6464

65+
// GitHub auth
66+
backend.add(import('@backstage/plugin-auth-backend-module-github-provider'));
67+
6568
backend.start();

0 commit comments

Comments
 (0)