opencode icon indicating copy to clipboard operation
opencode copied to clipboard

enhancement: support ghe.com copilot auth

Open dotned opened this issue 1 year ago • 7 comments

I saw the X post and the PR in respect to bringing GitHub Copilot to the providers list, great stuff. I note it doesn't cover ghe.com and wondered if that was something being considered?

dotned avatar Jun 24 '25 10:06 dotned

open to supporting it - just not sure what's involved. does copilot even work with GHE?

thdxr avatar Jun 24 '25 15:06 thdxr

Yes, we use ghe.com, GitHub Enterprise with Data Residency, and have CoPilot enabled. It's the same as the normal github.com setup with one small but significant difference. The url is customer specific. e.g. https://company.ghe.com

This means the URLs look like...

https://company.ghe.com/login/device/code https://company.ghe.com/login/oauth/access_token https://company.ways.ghe.com/copilot_internal/v2/token

I tried to see if I could authenticate without changing anything but these URLs in code and it worked. The issue will be in asking the user for thier "company" name as that is the dynamic element.

IDEs allow this connection a few ways but essentially asking for the Enterprise URL, https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/using-github-copilot-with-an-account-on-ghecom

dotned avatar Jun 25 '25 16:06 dotned

It would be amazing if this functionality was added. As already mentioned, just giving the user ability to set the URL to GitHub, eg. GITHUB_HOST to whatever they have. You can also get this context out

It's worth mentioning that what @dotned is talking about is GitHub Enterprise Cloud, not GitHub Enterprise Server. There's a lot of confusion around naming for the different products in GitHub. To the best of my knowledge these are sort of the products that exists:

  • GitHub Enterprise Cloud: GitHub Enterprise on GitHub.com, often using the abbreviation GHEC
  • GitHub Enterprise Cloud with Data Residency: GitHub Enterprise on GHE.com, often using the abbreviation GHECDR
  • GitHub Enterprise Server: Self-hosted GitHub Enterprise, often abbreviated as GHES

vegardx avatar Jul 07 '25 18:07 vegardx

Yes, we use ghe.com, GitHub Enterprise with Data Residency, and have CoPilot enabled. It's the same as the normal github.com setup with one small but significant difference. The url is customer specific. e.g. https://company.ghe.com

This means the URLs look like...

https://company.ghe.com/login/device/code https://company.ghe.com/login/oauth/access_token https://company.ways.ghe.com/copilot_internal/v2/token

I tried to see if I could authenticate without changing anything but these URLs in code and it worked. The issue will be in asking the user for thier "company" name as that is the dynamic element.

IDEs allow this connection a few ways but essentially asking for the Enterprise URL, https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/using-github-copilot-with-an-account-on-ghecom

@dotned I would be interested in the code workaround, where specifically did you changed it in the code? Are you using a clone install or npm? Thanks

FortinFred avatar Jul 20 '25 18:07 FortinFred

@FortinFred I pulled the code and updated the values directly in the github-copilot.ts file, and ran locally

Image Image

dotned avatar Jul 22 '25 08:07 dotned

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

rekram1-node avatar Dec 28 '25 01:12 rekram1-node

Why is this closed? Was there an official solution instead of that TypeScript hack? We need this exact thing too.

lzandman avatar Feb 04 '26 14:02 lzandman