Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Standalone integration with GitHub App not working #142

Open
yaronpri opened this issue Jan 15, 2025 · 1 comment · May be fixed by #144
Open

GitHub Standalone integration with GitHub App not working #142

yaronpri opened this issue Jan 15, 2025 · 1 comment · May be fixed by #144

Comments

@yaronpri
Copy link

yaronpri commented Jan 15, 2025

Hi,
When using a GitHub Standalone instance, the integration with Github App is not working, getting -

undefined
If .env file is modified ...

After reading this doc - where it says:

There is one case where an OAuth app is preferred over a GitHub App. If your app needs to access enterprise-level resources such as the enterprise object itself, you should use an OAuth app because a GitHub App cannot yet be given permissions against an enterprise.

I was able to fix the issue by:

  1. Created a OAuth App instead.
  2. Add the scope I would like to get access to as part of the authorization request - server.mjs
res.redirect(`https://github.com/login/oauth/authorize?client_id=${process.env.GITHUB_CLIENT_ID}&redirect_uri=${redirectUrl}&state=${req.session.state}&scope=user%20read:org%20read:enterprise%20copilot:manage_billing%20read:enterprise_billing`);

By doing the following I was able to read the metrics after performing GitHub login.

I am opening this as an issue as maybe there is better way to fix this.
Thanks

@karpikpl
Copy link
Collaborator

hey, thanks for providing your solution!
This makes sense, I've added that comment about enterprise-level resources.
We'll try to make either as an option, so code change is not required.

@karpikpl karpikpl linked a pull request Jan 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants