microsoft / microsoft/vscode

GitHub Copilot: Allow switching between GitHub and GitHub Enterprise accounts without manually changing authProvider

Open
#330,136 0 comments 2 reactions 1 assignee Claimed by @TylerLeonhardt View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

I would like GitHub Copilot in VS Code to support switching between an authenticated **GitHub.com account** and an authenticated **GitHub Enterprise (GHE) account** directly from the UI.

## Current setup

I have two accounts:

* **Account 1:** GitHub Enterprise (GHE)
* **Account 2:** regular GitHub.com

Both accounts have GitHub Copilot access/credits, and I want to use both in the **same VS Code profile and workspace**.

It is possible to authenticate both accounts at the same time. However, Copilot only uses the provider configured in:

```json
"github.copilot.advanced": {
"authProvider": "github"
}
```

or:

```json
"github.copilot.advanced": {
"authProvider": "github-enterprise"
}
```

Changing this setting and reloading the VS Code window works correctly: Copilot switches to the corresponding account and shows the correct credits.

## Problem

There is currently no convenient UI or command to switch between the two authenticated providers.

`Accounts -> Manage Extension Account Preferences -> GitHub Copilot Chat`

does not allow choosing between an authenticated GitHub.com account and an authenticated GitHub Enterprise account.

There is also confusing behavior during authentication:

1. When signed out of both accounts, Copilot offers both **GitHub** and **GHE** as sign-in providers.
2. If I sign in with GitHub first, subsequent Copilot sign-in attempts only offer GitHub.
3. If I sign in with GHE first, subsequent Copilot sign-in attempts only offer GHE.
4. To authenticate the other provider, I currently need to manually change `github.copilot.advanced.authProvider`, reload VS Code, and sign in again.

Once both accounts are authenticated, switching between them still requires manually editing `settings.json` and reloading VS Code every time.

## Requested behavior

Ideally, VS Code/Copilot would provide a command or UI such as:

* **GitHub Copilot: Switch Account**
* **GitHub Copilot: Switch Authentication Provider**

This could allow selecting between already authenticated accounts, for example:

* GitHub.com — Account 2
* GitHub Enterprise — Account 1

Alternatively, `Manage Extension Account Preferences` could include accounts from both the `github` and `github-enterprise` authentication providers.

The goal is to allow users who have Copilot access on both GitHub.com and GitHub Enterprise to switch between them without manually editing `github.copilot.advanced.authProvider` and reloading the VS Code window.

## Related issues

* Related: #326509
* Similar previous issue: #300230

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.