Skip to content

Instantly share code, notes, and snippets.

@padupe
Last active February 25, 2023 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save padupe/8906da2ae36a61dc94769e7b7f1d2e22 to your computer and use it in GitHub Desktop.
Save padupe/8906da2ae36a61dc94769e7b7f1d2e22 to your computer and use it in GitHub Desktop.
[Backstage] Getting Started GitHub Authentication on a Backstage Instance - Config at Front
// packages/app/src/App.tsx
// Há um import do pacote @backstage/core-components, que atualizaremos de maneira que fique:
import { AlertDisplay, OAuthRequestDialog, SignInProviderConfig, SignInPage } from '@backstage/core-components';
[...]
// Realizaremos ainda o import de um novo pacote:
import { githubAuthApiRef } from '@backstage/core-plugin-api';
[...]
// Adicionaremso ainda o seguinte trecho de código, onde estaremos criando o sistema de autenticação
// em nosso front-end.
const githubAuthProvider: SignInProviderConfig = {
id: 'github-auth-provider',
title: 'Github',
message: 'Realize login com sua conta Github',
apiRef: githubAuthApiRef,
};
const app = createApp({
apis,
components: {
SignInPage: props => (
<SignInPage
{...props}
auto
providers={[githubAuthProvider]}
/>
),
},
[...]
});
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment