You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to use GitHub Copilot with the CLI despite successfully logging in to my GitHub Copilot Business assigned account. The authentication process appears to complete, but attempting to use gh copilot commands results in an error indicating no valid OAuth token is detected. We are using an OAuth token, not a Personal Access Token (PAT).
Set debug mode and authenticate with GitHub:
GH_DEBUG=1 gh auth login --web -h github.com
Output:
? What is your preferred protocol for Git operations on this host? HTTPS
[git config credential.https://github.com.helper]
[git config credential.helper]
? Authenticate Git with your GitHub credentials? Yes
* Request at 2024-05-24 16:42:13.438777861 +0000 UTC m=+2.554865065
* Request to https://github.com/login/device/code
* Using proxy: <company-proxy>
* Request took 236.735793ms
! First copy your one-time code: ...
Press Enter to open github.com in your browser...
* Request at 2024-05-24 16:42:23.335165974 +0000 UTC m=+12.451253177
* Request to https://github.com/login/oauth/access_token
* Using proxy: <company-proxy>
* Request took 153.079748ms
* Request at 2024-05-24 16:42:28.49216627 +0000 UTC m=+17.608253476
* Request to https://github.com/login/oauth/access_token
* Using proxy: <company-proxy>
* Request took 216.292382ms
* Request at 2024-05-24 16:42:28.708593745 +0000 UTC m=+17.824680952
* Request to https://api.github.com/graphql
* Request took 304.10115ms
✓ Authentication complete.
- gh config set -h github.com git_protocol https
✓ Configured git protocol
! Authentication credentials saved in plain text
[git credential reject]
[git credential approve]
✓ Logged in as <user>
Verify authentication status:
gh auth status
Output:
github.com
✓ Logged in to github.com account <user> (/home/user/.config/gh/hosts.yml)
- Active account: true
- Git operations protocol: https
- Token: gho_************************************
- Token scopes: 'gist', 'read:org', 'repo', 'workflow'
* Request at 2024-05-24 16:51:34.133665211 +0000 UTC m=+0.200250187
* Request to https://api.githubcopilot.com/github/chat/threads
* Request took 308.46323ms
✗ Error: No valid GitHub CLI OAuth token detected
To get started with GitHub Copilot in the CLI, please run: gh auth login --web -h github.com to authenticate via web browser.
Expected Behavior:
GitHub Copilot should operate correctly, utilizing the authenticated session.
Environment:
GitHub CLI version: 2.49.2 (2024-05-14)
GitHub Copilot version: 1.0.3 (2024-05-08)
OS: CENTOS
Proxy: <company-proxy>
Additional Information:
The authentication process completes without error, and the token appears valid as verified by gh auth status and direct API calls using the token. However, the gh copilot commands fail to recognize the OAuth token.
The text was updated successfully, but these errors were encountered:
I'm sorry to hear you're having issues, @ffalkenberg!
If you look further down on your Copilot settings page, you should see whether or not the feature itself was enabled by your org admin. It'd look something like this:
The error message we received was quite misleading (No valid GitHub CLI OAuth token) and could benefit from improvement to help users diagnose proxy-related issues more effectively
Is not using proxy(all other requests are using proxy), just like the output pasted by @ffalkenberg at start. Because of this my org firewall blocks the request and I am not able to login.
Related Issue:
This issue appears to be related to GitHub issue #1.
Description:
I am unable to use GitHub Copilot with the CLI despite successfully logging in to my GitHub Copilot Business assigned account. The authentication process appears to complete, but attempting to use
gh copilot
commands results in an error indicating no valid OAuth token is detected. We are using an OAuth token, not a Personal Access Token (PAT).Set debug mode and authenticate with GitHub:
Output:
Verify authentication status:
Output:
Confirm token validity with an API call:
curl -H "Authorization: token gho_<token>" https://api.github.com/user
Output:
Attempt to use GitHub Copilot in CLI:
GH_DEBUG=1 gh copilot explain "sudo apt-get"
Output:
Expected Behavior:
GitHub Copilot should operate correctly, utilizing the authenticated session.
Environment:
2.49.2 (2024-05-14)
1.0.3 (2024-05-08)
<company-proxy>
Additional Information:
The authentication process completes without error, and the token appears valid as verified by
gh auth status
and direct API calls using the token. However, thegh copilot
commands fail to recognize the OAuth token.The text was updated successfully, but these errors were encountered: