VS Code GitHub Copilot Enterprise login keeps redirecting to github.com / GHE.com – how to configure Enterprise Server? #183642
Replies: 4 comments
|
Hi @mspatil214, I can clarify this for you! The "GHE.com" option is confusing, but here is exactly why it's failing and how to bypass it.
Ensure your "github-enterprise.uri" setting is correct in your settings.json (e.g., "https://github.your-company.com"). Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P). Type and run: GitHub Enterprise: Sign in. This should explicitly trigger the authentication against your self-hosted URL defined in step 1, rather than trying to route you to the public cloud or GHE.com.
Hope this gets you unstuck! |
|
Hi @mspatil214 Copilot Authentication Issue on GitHub Enterprise Server (Answer)Problem Why this happens
Correct way to sign in (Solution)Use VS Code’s GitHub Enterprise sign-in flow instead. 1. Set your Enterprise Server URLOpen VS Code settings.json and add: "github-enterprise.uri": "https://your-enterprise-server.com"2. Sign in using Command PaletteOpen Command Palette Run: This ensures authentication happens against your self-hosted Enterprise Server, not public GitHub. |
|
Great answer by @Harsimran-Dalal ! The GitHub Enterprise: Sign in command is definitely the correct path for Self-Hosted servers. Just adding one critical troubleshooting tip for anyone still stuck after signing in: If you sign in successfully but Copilot still refuses to activate (or shows license errors), check with your admin if GitHub Connect is enabled on your Enterprise Server. Even though you are on a self-hosted server, the Copilot extension still needs to verify your seat license against GitHub.com. Without GitHub Connect bridging your server to the cloud, the extension often fails to validate the license even if your local auth is correct. |
|
This behavior is expected with the current GitHub Copilot authentication flow. GitHub Copilot in VS Code does not support direct authentication against GitHub Enterprise Server (self-hosted). Copilot authentication is only supported via: GitHub.com GitHub Enterprise Cloud (*.ghe.com) The “Continue with GHE.com” option refers only to GitHub Enterprise Cloud, not Enterprise Server. Custom domains used by self-hosted Enterprise Server instances (e.g. https://github.company.com) are not accepted, which is why the URL validation fails. The VS Code setting: "github-enterprise.uri": "https://..." only affects the GitHub extension (repos, PRs, issues) and does not influence Copilot’s OAuth flow. Current options Sign in to Copilot using a GitHub.com account that is assigned a Copilot license by your organization Use GitHub Enterprise Cloud if Enterprise Server–native Copilot auth is required At the moment, there is no supported or documented way to force Copilot in VS Code to authenticate directly against a self-hosted GitHub Enterprise Server instance. Clarifying this limitation in the UI and documentation would likely prevent confusion for Enterprise Server users. |
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Question
Copilot Feature Area
VS Code
Body
I’m trying to use GitHub Copilot with an enterprise license in VS Code, but I’m stuck in the authentication flow.
My situation:
Copilot is installed and enabled in VS Code
I have an enterprise-provided Copilot license
My organization uses GitHub Enterprise Server (self-hosted), not GitHub Enterprise Cloud
Problem:
When signing in from VS Code, the Copilot login popup shows:
“Continue with GitHub”
“Continue with GHE.com”
If I choose Continue with GitHub, it redirects to public github.com
If I choose Continue with GHE.com, it expects a *.ghe.com URL and rejects my Enterprise Server URL with an error like:
“You must enter a valid GHE.com instance (e.g. https://octocat.ghe.com)”
What I tried:
Setting the Enterprise Server URL in VS Code settings:
"github-enterprise.uri": "https://"
Signing out of all GitHub accounts in VS Code
Restarting VS Code
Reinstalling GitHub Copilot extension
Questions:
What is the correct way to authenticate GitHub Copilot in VS Code when using GitHub Enterprise Server (not GHE.com)?
Is the “Continue with GHE.com” option only meant for GitHub Enterprise Cloud, not self-hosted Enterprise Server?
Is there an official or recommended flow to force VS Code Copilot to authenticate against an Enterprise Server domain instead of public github.com?
Any guidance or official documentation would be appreciated.
All reactions