GitHub login not working, no auth provider registered

See original GitHub issue

We have 2 auth provider configured Guest and Github.

We are getting the below exception with Github auth provider

{“error”:{“name”:“NotFoundError”,“message”:“Auth provider registered for ‘github’ is misconfigured. This could mean the configs under auth.providers.github are missing or the environment variables used are not defined. Check the auth backend plugin logs when the backend starts to see more details.”,“stack”:"NotFoundError: Auth provider registered for ‘github’ is misconfigured. This could mean the configs under auth.providers.github are missing or the environment variables used are not defined. Check the auth backend plugin logs when the backend starts to see more details.\n at

Github should open the redirect url for authentication

Updated App-config.yaml file

Section Integration and Auth as below

auth: providers: github: development: clientId: $env: AUTH_GITHUB_CLIENT_ID clientSecret: $env: AUTH_GITHUB_CLIENT_SECRET production: clientId: $env: AUTH_GITHUB_CLIENT_ID clientSecret: $env: AUTH_GITHUB_CLIENT_SECRET

integrations: github: - host: github.com apps: - $include: github-app-credentials.yaml

  1. Start backstage
  2. Got to login screen, click on Github auth
  3. Exception screen pop up pointing to localhost:7000/api/auth/github URL

Context

We are not able to standup and import custom templates to our environment.

Note the same exception is observed during importing templates.

Your Environment

  • Browser Information:

  • Output of yarn backstage-cli info:


Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
HieuMinh67commented, Jul 11, 2022

ref #11119 (comment)

@HieuMinh67 You can provide a auth provider like this

import {
  createRouter,
  providers,
} from '@backstage/plugin-auth-backend';

// ...

return await createRouter({
    logger: env.logger,
    config: env.config,
    database: env.database,
    discovery: env.discovery,
    tokenManager: env.tokenManager,
    providerFactories: {
      github: providers.github.create({
        signIn: {
          resolver(info, ctx) {
            const { profile } = info;
            const { displayName } = profile;
            const userRef = `user:default/${displayName}`; // Must be a full entity reference

            return ctx.issueToken({
              claims: {
                sub: userRef, // The user's own identity
                ent: [userRef], // A list of identities that the user claims ownership through
              },
            });
          }
        },
      }),
    }
  });

I have figured it out, I insert auth inside backend: in app-config.yaml

1reaction
HieuMinh67commented, Jul 11, 2022

Ok and is the above file app-config.yaml?

And also what does your packages/backend/src/plugins/auth.ts look like?

Yes, above file app-config.yaml and I didn’t change packages/backend/src/plugins/auth.ts

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Authentication Provider - Backstage.io
The Backstage core-plugin-api package comes with a GitHub authentication provider that can authenticate users using GitHub or GitHub Enterprise OAuth.
Read more >
Using GitHub Auth with Backstage - Roadie.io
Update Sept 2021: Backstage now supports GitHub authentication via GitHub apps. If you are using a GitHub app, you do not need to...
Read more >
Setting up a Tanzu Application Platform GUI authentication ...
This feature is a work in progress. ... auth providers config loginPage: github: title: Github Login message: Enter with your GitHub account.
Read more >
Use GitHub as an authentication provider - GitLab Docs
This error can occur because of a network connectivity issue between your GitLab instance and GitHub Enterprise. To check for a connectivity issue:...
Read more >
Authentication and Authorization - ServiceStack Docs
ServiceStack also includes a number of Auth Providers which "Authenticate ... populated on the HTTP IRequest and not saved in the registered Cache...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found