The OAuth App CLIENT_ID for GitHub Enterprise (GHE) is best to be customizable #7584

Open
opened 2026-02-16 18:07:39 -05:00 by yindo · 5 comments
Owner

Originally created by @artorias-sif on GitHub (Jan 25, 2026).

Originally assigned to: @rekram1-node on GitHub.

https://github.com/anomalyco/opencode/blob/23d85f47397c594e62929682b27835099b788fdf/packages/opencode/src/plugin/copilot.ts#L5

The OAuth App for both GitHub and GHE is independent.
Even if you register an OAuth App on github.com:
the client_id can only be effective on github.com and cannot be used directly for GHE.

The reason is:
GHE's OAuth application is not shared across domains; it is managed separately within your internal platform.

This means
It is better to create a new OAuth App on your GHE and then use the new client_id.

Originally created by @artorias-sif on GitHub (Jan 25, 2026). Originally assigned to: @rekram1-node on GitHub. https://github.com/anomalyco/opencode/blob/23d85f47397c594e62929682b27835099b788fdf/packages/opencode/src/plugin/copilot.ts#L5 The OAuth App for both GitHub and GHE is independent. Even if you register an OAuth App on github.com: the client_id can only be effective on github.com and cannot be used directly for GHE. The reason is: GHE's OAuth application is not shared across domains; it is managed separately within your internal platform. This means It is better to create a new OAuth App on your GHE and then use the new client_id.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 25, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #3936: Github Enterprise authorization - discusses the same problem that GHE OAuth Apps are independent and require separate client_id configuration

Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Jan 25, 2026): This issue might be a duplicate of existing issues. Please check: - #3936: Github Enterprise authorization - discusses the same problem that GHE OAuth Apps are independent and require separate client_id configuration Feel free to ignore if this doesn't address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Jan 25, 2026):

yeah the github enterprise stuff has a few blockers, it is in the works tho

@rekram1-node commented on GitHub (Jan 25, 2026): yeah the github enterprise stuff has a few blockers, it is in the works tho
Author
Owner

@vegardx commented on GitHub (Feb 3, 2026):

While GitHub Marketplace isn't available on GitHub Enterprise Cloud with Data Residency there are ways of getting GitHub Apps installed. They already do this with the Slack integration. I'll send this to some people in GitHub so perhaps we can get the app installed on ghe.com.

That said - it would be amazing if we could just expose baseUrl and clientId.

@vegardx commented on GitHub (Feb 3, 2026): While GitHub Marketplace isn't available on GitHub Enterprise Cloud with Data Residency there are ways of getting GitHub Apps installed. They already do this with the Slack integration. I'll send this to some people in GitHub so perhaps we can get the app installed on ghe.com. That said - it would be amazing if we could just expose baseUrl and clientId.
Author
Owner

@JosXa commented on GitHub (Feb 6, 2026):

While GitHub Marketplace isn't available on GitHub Enterprise Cloud with Data Residency there are ways of getting GitHub Apps installed. They already do this with the Slack integration. I'll send this to some people in GitHub so perhaps we can get the app installed on ghe.com.

That said - it would be amazing if we could just expose baseUrl and clientId.

As of 1.1.52 (or so), you can now fully override the plugin using your own custom version (with the same name) and it'll work with opencode auth login.

Essentially, you can

  1. Copy https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/plugin/copilot.ts to .opencode/plugin/copilot.ts
  2. Enter your own CLIENT_ID
  3. Replace IIFE helper with a regular IIFE
  4. Hardcode the version number (doesn't matter)
  5. Optionally provide a const DEFAULT_ENTERPRISE_DOMAIN = "YOURS.ghe.com" and use it in authorize for getUrls
@JosXa commented on GitHub (Feb 6, 2026): > While GitHub Marketplace isn't available on GitHub Enterprise Cloud with Data Residency there are ways of getting GitHub Apps installed. They already do this with the Slack integration. I'll send this to some people in GitHub so perhaps we can get the app installed on ghe.com. > > That said - it would be amazing if we could just expose baseUrl and clientId. As of 1.1.52 (or so), you can now fully override the plugin using your own custom version (with the same name) and it'll work with `opencode auth login`. Essentially, you can 1. Copy https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/plugin/copilot.ts to `.opencode/plugin/copilot.ts` 2. Enter your own `CLIENT_ID` 3. Replace IIFE helper with a regular IIFE 4. Hardcode the version number (doesn't matter) 5. Optionally provide a `const DEFAULT_ENTERPRISE_DOMAIN = "YOURS.ghe.com"` and use it in `authorize` for `getUrls`
Author
Owner

@Eckii24 commented on GitHub (Feb 10, 2026):

While GitHub Marketplace isn't available on GitHub Enterprise Cloud with Data Residency there are ways of getting GitHub Apps installed. They already do this with the Slack integration. I'll send this to some people in GitHub so perhaps we can get the app installed on ghe.com.
That said - it would be amazing if we could just expose baseUrl and clientId.

As of 1.1.52 (or so), you can now fully override the plugin using your own custom version (with the same name) and it'll work with opencode auth login.

Essentially, you can

  1. Copy https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/plugin/copilot.ts to .opencode/plugin/copilot.ts
  2. Enter your own CLIENT_ID
  3. Replace IIFE helper with a regular IIFE
  4. Hardcode the version number (doesn't matter)
  5. Optionally provide a const DEFAULT_ENTERPRISE_DOMAIN = "YOURS.ghe.com" and use it in authorize for getUrls

How do you actually handle the imports in this overwrite?
Especially the @/installation and @/utils/iife?

@Eckii24 commented on GitHub (Feb 10, 2026): > > While GitHub Marketplace isn't available on GitHub Enterprise Cloud with Data Residency there are ways of getting GitHub Apps installed. They already do this with the Slack integration. I'll send this to some people in GitHub so perhaps we can get the app installed on ghe.com. > > That said - it would be amazing if we could just expose baseUrl and clientId. > > As of 1.1.52 (or so), you can now fully override the plugin using your own custom version (with the same name) and it'll work with `opencode auth login`. > > Essentially, you can > > 1. Copy https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/plugin/copilot.ts to `.opencode/plugin/copilot.ts` > 2. Enter your own `CLIENT_ID` > 3. Replace IIFE helper with a regular IIFE > 4. Hardcode the version number (doesn't matter) > 5. Optionally provide a `const DEFAULT_ENTERPRISE_DOMAIN = "YOURS.ghe.com"` and use it in `authorize` for `getUrls` How do you actually handle the imports in this overwrite? Especially the `@/installation` and `@/utils/iife`?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7584