backstage: Latest release 1.24.0 breaks GitHub auth
📜 Description
I’ve been trying for the last day to get GitHub auth working, after upgrading to the latest release, assuming it was my fault, even though my config hasn’t changed. Then I noticed that the latest release introduced braking changes to the auth providers. I downloaded release 1.23.4 and build it and it is working as before. It would be nice if you had made sure the auth provider plugins worked before releasing these changes.
👍 Expected behavior
Return a HTTP 200
👎 Actual Behavior with Screenshots
This is the error response gotten when trying to auth against gitHub using a GitHub App and the PAT:
"error": {
"name": "NotFoundError",
"message": "Unknown auth provider 'github'",
"stack": "NotFoundError: Unknown auth provider 'github'\n at <anonymous> (/Users/paulpog/backstage/node_modules/@backstage/plugin-auth-backend/src/service/router.ts:161:11)\n at handleReturn (/Users/paulpog/backstage/node_modules/express-promise-router/lib/express-promise-router.js:24:23)\n at /Users/paulpog/backstage/node_modules/express-promise-router/lib/express-promise-router.js:64:7\n at Layer.handle [as handle_request] (/Users/paulpog/backstage/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:328:13)\n at /Users/paulpog/backstage/node_modules/express/lib/router/index.js:286:9\n at param (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:365:14)\n at param (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:376:14)\n at Function.process_params (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:421:3)\n at next (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:280:10)\n at /Users/paulpog/backstage/node_modules/express/lib/router/index.js:646:15\n at next (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:265:14)\n at Function.handle (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:175:3)\n at router (/Users/paulpog/backstage/node_modules/express/lib/router/index.js:47:12)\n at handleReturn (/Users/paulpog/backstage/node_modules/express-promise-router/lib/express-promise-router.js:24:23)\n at router (/Users/paulpog/backstage/node_modules/express-promise-router/lib/express-promise-router.js:64:7)"
},
"request": {
"method": "GET",
"url": "/api/auth/github/refresh?optional&scope=read%3Auser&env=development"
},
"response": {
"statusCode": 404
}
}
👟 Reproduction steps
settings->Authentication Providers -> choose GitHub->sign in
📃 Provide the context for the Bug.
No response
🖥️ Your Environment
local installation of backstage with env:development
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn’t find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
None
About this issue
- Original URL
- State: closed
- Created 3 months ago
- Reactions: 4
- Comments: 67 (25 by maintainers)
have you switched to the new backend system by changing your
packages/backend/src/index.ts
according to https://backstage.github.io/upgrade-helper/?from=1.23.4&to=1.24.0 ?If yes, you might have missed adding
More info in https://backstage.io/docs/backend-system/building-backends/migrating/#the-auth-plugin
After adding the resolvers, it worked. @freben Thanks.
And
was the answer for my problem 🙏 Thanks!
The following pages need updating (and probably other providers too)
The patch I applied is below. Note that you’ll need to import the entities as I mentioned on this message: https://github.com/backstage/backstage/issues/23748#issuecomment-2066290169
Thanks everyone! Confirming adding a user to
examples\org.yaml
fixed my problem also. I appreciated the patience as this is all new to me 😃Alright, I think we’ll consider this a general “migration questions” thread at this point, rather than an actual underlying issue to be fixed. That’s perfectly fine, but just noting that if I understand things correctly, there are no actionable outcomes besides docs improvements which we agree really are needed. I’ll close for now, but of course it stays around and is searchable and hopefully helps others who encounter the same type of situations.
Having the same issue. Did all the steps as @sivaprasadreddy, now something different appeared:
Login failed, user profile does not contain an email
UPD. Fixed by making my email visible in GitHub and selecting it in settings.
I followed all the steps mentioned in this thread:
But, still getting “The GitHub provider is not configured to support sign-in” error.
Obviously hardcoding the users will also work. Pulling from the org keeps it up-to-date and doesn’t require redeploying whenever a dev joins or leaves the company.
Yeah, you need another plugin to import your User + Group + Repo entities from github.
@bluu926 You are meant to add a catalog integration with some provider of actual user/group data, like ldap or whatnot. See the different “Org” sections under https://backstage.io/docs/integrations/
@sivaprasadreddy you probably forgot to add the
signIn
key on your provider in app-config. https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin@freben I verified same problem using ‘npx @backstage/create-app@latest’ and adding all necessary changes to enable Microsoft auth integration (about 10 lines of code and little else!).
Git repo is here: https://github.com/giocolas/backstage-microsoft-auth
Microsoft configuration is on my local file app-config.local.yaml (not included in repo)
This is backend log:
this is how displayed in my screen:
Yeah i think the docs need to be updated now that the default is the new backend system. See this section instead:
https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin
It shows how you add the
signIn
key in config. There’s indeed no longer aplugins
folder in thereHey Peeps 👋
I’ve just upgraded my repo from
1.22.2
to1.24.0
and I am using a GitHub oAuth App and it all seems fine to me … so far.Not sure if it helps at all but here is the PR I have to upgrade versions.
I know @pogo61 has mentioned they are not using the oAuth App so sadly this won’t help in that case, but others above have also mentioned they have issues with oAuth.
Hopefully this helps!
Thanks!
@ryan-WORK sorry, that did nothing… same response Just to make sure we are on the same page… I’m not using OAuth, just the basic GitHub App with the PAT