Last active
February 25, 2023 18:23
-
-
Save padupe/8906da2ae36a61dc94769e7b7f1d2e22 to your computer and use it in GitHub Desktop.
[Backstage] Getting Started GitHub Authentication on a Backstage Instance - Config at Front
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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