Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github login failed every time #160649

Closed
tsgsz opened this issue Sep 11, 2022 · 83 comments
Closed

github login failed every time #160649

tsgsz opened this issue Sep 11, 2022 · 83 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@tsgsz
Copy link

tsgsz commented Sep 11, 2022

Type: Bug

The login step in browser is good, and successfull, but when redirect to vscode, vscode can also recive the redirect request, because it will pop up a window to ask me if allow it, but after that, it stuck until timeout

VS Code version: Code 1.71.0 (784b017, 2022-09-01T07:36:10.600Z)
OS version: Windows_NT x64 10.0.22000
Modes:
Sandboxed: No
Remote OS version: Linux x64 3.10.0-1127.19.1.el7.x86_64

System Info
Item Value
CPUs Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz (4 x 3300)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 31.91GB (24.16GB free)
Process Argv --crash-reporter-id a72f7270-60dd-4eec-8d30-1feb1135c48c
Screen Reader no
VM 0%
Item Value
Remote SSH: 阿里云
OS Linux x64 3.10.0-1127.19.1.el7.x86_64
CPUs Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz (2 x 2499)
Memory (System) 7.64GB (4.40GB free)
VM 25%
Extensions (11)
Extension Author (truncated) Version
vscode-docker ms- 1.22.1
vscode-language-pack-zh-hans MS- 1.71.9070915
python ms- 2022.14.0
vscode-pylance ms- 2022.9.10
jupyter ms- 2022.8.1002431955
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.9
remote-ssh ms- 0.84.0
remote-ssh-edit ms- 0.80.0
remote-wsl ms- 0.66.3
vim vsc 1.23.2
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411cf:30557515
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vscaat:30438848
pylanb8912:30545647
vsclangdf:30486550
c4g48928:30535728
hb751961:30553087
dsvsc012:30540252
azure-dev_surveyone:30548225
i497e931:30553904

@tsgsz
Copy link
Author

tsgsz commented Sep 11, 2022

And I have tried win11, win10, MACOS, also with proxy or not with proxy, nothing helped

@tsgsz
Copy link
Author

tsgsz commented Sep 16, 2022

Any update ?

@TylerLeonhardt
Copy link
Member

Sorry could you attach a video or a gif? That would really help me understand what you're seeing.

/gifPlease

@vscodenpa
Copy link

Thanks for reporting this issue! Unfortunately, it's hard for us to understand what issue you're seeing. Please help us out by providing a screen recording showing exactly what isn't working as expected. While we can work with most standard formats, .gif files are preferred as they are displayed inline on GitHub. You may find https://gifcap.dev helpful as a browser-based gif recording tool.

If the issue depends on keyboard input, you can help us by enabling screencast mode for the recording (Developer: Toggle Screencast Mode in the command palette).

Happy coding!

@vscodenpa vscodenpa added the info-needed Issue requires more information from poster label Sep 17, 2022
@ronakay22
Copy link

ronakay22 commented Sep 17, 2022 via email

@tsgsz
Copy link
Author

tsgsz commented Sep 21, 2022

/gif
GIF 2022-9-21 星期三 23-58-30
sorry for the gif delay

@TylerLeonhardt
Copy link
Member

can you provide the contents of the GitHub Authentication output pane:
image

And also anything that shows up in Dev Tools:

  • ctrl + shift + P
  • "Dev Tools"

@tsgsz
Copy link
Author

tsgsz commented Sep 25, 2022

can you provide the contents of the GitHub Authentication output pane: image

And also anything that shows up in Dev Tools:

  • ctrl + shift + P
  • "Dev Tools"

0751fbe21786314d50f2a02646c4862
Nothing else

@TylerLeonhardt
Copy link
Member

Very interesting... you see the spinning sign in to github.com... in your status bar... can you click on that and click cancel and then it'll ask you via a notification if you want to try logging in a different way... can you try that? Let me know if you need a video to understand what I'm talking about.

@tsgsz
Copy link
Author

tsgsz commented Oct 2, 2022

Very interesting... you see the spinning sign in to github.com... in your status bar... can you click on that and click cancel and then it'll ask you via a notification if you want to try logging in a different way... can you try that? Let me know if you need a video to understand what I'm talking about.

Already tried so many times, here is the result GIF 2022-10-2 星期日 10-58-25

@tsgsz
Copy link
Author

tsgsz commented Oct 6, 2022

Very interesting... you see the spinning sign in to github.com... in your status bar... can you click on that and click cancel and then it'll ask you via a notification if you want to try logging in a different way... can you try that? Let me know if you need a video to understand what I'm talking about.

Hi, any update? This problem keeps me can't use the codepolit actually, and I really really want to try...

@tsgsz
Copy link
Author

tsgsz commented Oct 11, 2022

Very interesting... you see the spinning sign in to github.com... in your status bar... can you click on that and click cancel and then it'll ask you via a notification if you want to try logging in a different way... can you try that? Let me know if you need a video to understand what I'm talking about.

Already tried so many times, here is the result GIF 2022-10-2 星期日 10-58-25 GIF 2022-10-2 星期日 10-58-25

Hi, is there any update?

@TylerLeonhardt
Copy link
Member

@tsgsz let's try to get you unblocked first... can you open up Windows Credential Manager and go to Windows Credentials
image

Then look for any credentials that start with vscode and delete them. Then try logging in again.

@tsgsz
Copy link
Author

tsgsz commented Oct 13, 2022

@tsgsz let's try to get you unblocked first... can you open up Windows Credential Manager and go to Windows Credentials image

Then look for any credentials that start with vscode and delete them. Then try logging in again

There is no credentials that start with vscode, I delete all of the rest credentials and loggin again, the result is all the same.

I really don't think it's the credential problem, because couple of days ago, I try it in my mac, didn't work either, and my windows also resinstalled once, nerver work.

@TylerLeonhardt
Copy link
Member

Let's see if this is a keytar issue then... first log in in vscode (even though it fails)

if you have nodejs installed, you can run this simple one-liner to see if the problem is how your keychain is setup:

npx @emacs-grammarly/keytar-cli find-creds -s vscodevscode.github-authentication

or if you're on Insiders:

npx @emacs-grammarly/keytar-cli find-creds -s vscode-insidersvscode.github-authentication

This is using the following open source package: https://github.com/emacs-grammarly/keytar-cli

What you should get is something like this:

[
  {
    account: 'github.auth',
    password: '....... longggg string ......'
  }
]

NOTE: on macOS I got a system prompt to allow this process to access the keychain... that may or may not be the case for you

Additionally, we can see if we can properly set passwords:

npx @emacs-grammarly/keytar-cli set-pass testingvscode testingvscode testingvscode

and then

npx @emacs-grammarly/keytar-cli find-creds -s testingvscode

should give us that newly created password.

@tsgsz
Copy link
Author

tsgsz commented Oct 16, 2022

Let's see if this is a keytar issue then... first log in in vscode (even though it fails)

if you have nodejs installed, you can run this simple one-liner to see if the problem is how your keychain is setup:

npx @emacs-grammarly/keytar-cli find-creds -s vscodevscode.github-authentication

or if you're on Insiders:

npx @emacs-grammarly/keytar-cli find-creds -s vscode-insidersvscode.github-authentication

This is using the following open source package: https://github.com/emacs-grammarly/keytar-cli

What you should get is something like this:

[
  {
    account: 'github.auth',
    password: '....... longggg string ......'
  }
]

NOTE: on macOS I got a system prompt to allow this process to access the keychain... that may or may not be the case for you

Additionally, we can see if we can properly set passwords:

npx @emacs-grammarly/keytar-cli set-pass testingvscode testingvscode testingvscode

and then

npx @emacs-grammarly/keytar-cli find-creds -s testingvscode

should give us that newly created password.

npx @emacs-grammarly/keytar-cli find-creds -s vscodevscode.github-authentication this return "[]"
npx @emacs-grammarly/keytar-cli set-pass testingvscode testingvscode testingvscode this is normal

and I manually set vscodevscode.github-authentication using the set-pass command, the output keytar is ok, just vsocde still can't login

@tsgsz
Copy link
Author

tsgsz commented Oct 21, 2022

My friend, any clue?

@tsgsz
Copy link
Author

tsgsz commented Oct 30, 2022

Hi, is there anyone still working on this issue?

@TylerLeonhardt
Copy link
Member

I just got back from vacation and am juggling multiple items. This issue hasn't been forgotten

@tsgsz
Copy link
Author

tsgsz commented Nov 3, 2022

I just got back from vacation and am juggling multiple items. This issue hasn't been forgotten

thanks

@TylerLeonhardt
Copy link
Member

@tsgsz can you run these two lines in PowerShell and tell me what you get?

Invoke-RestMethod -Method Post https://vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token
Invoke-RestMethod -Method Post https://vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token -Body 'code=123'

They will fail, but I want to make sure you at least get a response from the server

@tsgsz
Copy link
Author

tsgsz commented Nov 5, 2022

result as follow:

03799d05ee50ac0bbd50e52c5969ee5

the text version:
Invoke-RestMethod : No code property provided in body

  • Invoke-RestMethod -Method Post https://vscode.dev/codeExchangeProxyEn ...
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod],WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
    
    

Invoke-RestMethod : bad_verification_code: The code passed is incorrect or expired. (https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#bad-verification-code)

  • Invoke-RestMethod -Method Post https://vscode.dev/codeExchangeProxyEn ...
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod],WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
    

@tsgsz
Copy link
Author

tsgsz commented Dec 4, 2022

knock knock

@TylerLeonhardt
Copy link
Member

Believe it or not, but I was on another vacation. I'm back now... til the holidays... so hopefully we can make some progress here.

It's good that PowerShell was able to make a request to these urls... that's worth something. Though, to be honest, I'm not sure why VS Code would be having trouble here.

Do you have any proxies applied to your machine by your organization?

One thing we could try... have you used Fiddler before? Fiddler can be used to see if the request to vscode.dev/codeExchangeProxyEnd..... actually finishes. By installing that, and running it, it should start listening to the traffic that your machine makes and print it out:

Image

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2022
@microsoft microsoft deleted a comment from vscodenpa Dec 13, 2022
@melMass
Copy link

melMass commented Dec 19, 2022

Hi,

I've just read the full issue and I have the exact same issue.
I'm using ssh keys to login to github, this works everywhere except in vscode.
image

It does popup the browser login window
image

But clicking signing with browser just goes to a blank localhost page most of the time, once it did show me a successfully login you can go back to the app, but in vscode it was still complaining.

npx @emacs-grammarly/keytar-cli find-creds -s vscode-insidersvscode.github-authentication
Returns

[
  {
    account: 'github.auth',
    password: 'AQxlmzCMdedeFgtEgtjogfetgwt/lfsAefgAgteagt3geugtYerSgetOYrDD\n' +
      'Blablablabal(removed)'
  }
]

And this is Github Auth Log:
image

This only happens on my windows machine and funny to note that while trying to solve this, every single commits had a different user... not sure why but it might be related:
image

@tschams
Copy link

tschams commented Mar 29, 2023

Not sure about all of your issues exactly, what solved my issue was adding "http.proxySupport": "off" to vs code settings I believe for extensions.

@tsgsz
Copy link
Author

tsgsz commented Mar 30, 2023

Not sure about all of your issues exactly, what solved my issue was adding "http.proxySupport": "off" to vs code settings I believe for extensions.

I did this, succeed, thanks

@PaulinaLL
Copy link

same issue on mac

@tsgsz
Copy link
Author

tsgsz commented Mar 30, 2023

Not sure about all of your issues exactly, what solved my issue was adding "http.proxySupport": "off" to vs code settings I believe for extensions.

I did this, succeed, thanks

also succeed on windows. I think this is the anwser @TylerLeonhardt

@TylerLeonhardt
Copy link
Member

@tsgsz I'm so glad! I've felt really bad that we haven't made much progress before. This is an eye opening discovery!

@TylerLeonhardt
Copy link
Member

@tsgsz do you have a corporate proxy applied on these machines?

@tsgsz
Copy link
Author

tsgsz commented Mar 31, 2023

I don't think so, the system variable is empty, and a new mac also has the problem.

@tuxslayer
Copy link

Having the same problem on macos 13.3

@TylerLeonhardt
Copy link
Member

Can you try out @chrmarti's Proxy debugging extension here: microsoft/vscode-remote-release#8248 (comment)

and let me know how it goes?

@ylht
Copy link

ylht commented Apr 4, 2023

I guess that it maybe dns pollution, can you try to write the ip into the hosts file?

@HoniSanders
Copy link

HoniSanders commented Apr 19, 2023

Try going to settings/Application/Proxy:

Http: Proxy Strict SSL

  • Controls whether the proxy server certificate should be verified against the list of supplied CAs.

Uncheck that box!

You can see that expired certificates can lead to this problem in this thread: #97434

@sumanth-lingappa
Copy link

Not sure about all of your issues exactly, what solved my issue was adding "http.proxySupport": "off" to vs code settings I believe for extensions.

This solved for me as well. However @TylerLeonhardt, will we have any problem to turn-off http.proxySupport?

@TylerLeonhardt
Copy link
Member

@chrmarti is the best person to answer that.

@chrmarti
Copy link
Collaborator

chrmarti commented May 2, 2023

Not sure about all of your issues exactly, what solved my issue was adding "http.proxySupport": "off" to vs code settings I believe for extensions.

This solved for me as well. However @TylerLeonhardt, will we have any problem to turn-off http.proxySupport?

You won't see any issues if you are not behind a network proxy. This still suggests that there is a bug on our side.

Could you install the Network Proxy Test extension (https://marketplace.visualstudio.com/items?itemName=chrmarti.network-proxy-test) and check the output of F1 > Network Proxy Test: Test Connection in VS Code?

@sumanth-lingappa
Copy link

@chrmarti You want me to send the output of the above run with or without "http.proxySupport":"off" ?

@chrmarti
Copy link
Collaborator

chrmarti commented May 3, 2023

@sumanth-lingappa Without "http.proxySupport":"off" is the important one. Thanks.

@sumanth-lingappa
Copy link

Not sure about all of your issues exactly, what solved my issue was adding "http.proxySupport": "off" to vs code settings I believe for extensions.

This solved for me as well. However @TylerLeonhardt, will we have any problem to turn-off http.proxySupport?

You won't see any issues if you are not behind a network proxy. This still suggests that there is a bug on our side.

Could you install the Network Proxy Test extension (https://marketplace.visualstudio.com/items?itemName=chrmarti.network-proxy-test) and check the output of F1 > Network Proxy Test: Test Connection in VS Code?

Note: Make sure to replace all sensitive information with dummy values before sharing this output.

VS Code 1.77.3 (704ed70d4fd1c6bd6342c436f1ede30d1cff4710)
Network Proxy Test 0.0.6
darwin 22.1.0 x64

Settings:
- http.proxy: 
- http.proxyAuthorization: null
- http.proxyStrictSSL: true
- http.proxySupport: override
- http.systemCertificates: true

Environment variables:

Sending GET request to https://example.com...
vscode-proxy-agent: PROXY 127.0.0.1:8009
Received error: certificate has expired (CERT_HAS_EXPIRED)
Retrying while ignoring certificate issues to collect information on the certificate chain.

Sending GET request to https://example.com (allowing unauthorized)...
vscode-proxy-agent: PROXY 127.0.0.1:8009
Received response:
- Status: 200 OK
Certificate chain:
- Subject: www.example.org (Internet Corporation for Assigned Names and Numbers)
  Subject alt: DNS:www.example.org, DNS:example.net, DNS:example.edu, DNS:example.com, DNS:example.org, DNS:www.example.com, DNS:www.example.edu, DNS:www.example.net
  Validity: Jan 13 00:00:00 2023 GMT - Feb 13 23:59:59 2024 GMT
  Fingerprint: 80:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:44
- Subject: Network Security (iboss Network Security)
  Validity: Nov 23 06:51:30 2022 GMT - Dec 25 06:51:30 2023 GMT
  Fingerprint: 23:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:FA
  Self-signed

@chrmarti
Copy link
Collaborator

chrmarti commented May 4, 2023

@sumanth-lingappa There is a proxy configured in your OS running on your local machine at 127.0.0.1:8009. It issues its own certificates and has the CA certificate "Network Security (iboss Network Security)" registered in your OS as a root certificate. That root certificate has expired and is causing the request to fail.

You could uninstall that proxy or update its root certificate in your OS if you want to keep it running.

@chrmarti
Copy link
Collaborator

chrmarti commented May 4, 2023

@sumanth-lingappa Does searching for extensions in VS Code's Extensions viewlet work? I would expect that to use the OS setting and fail too ("http.proxySupport":"off" won't affect that). 🤔

@chrmarti
Copy link
Collaborator

chrmarti commented May 4, 2023

@sumanth-lingappa I misread the end date of the "Network Security (iboss Network Security)" certificate. It has not expired, but the first connection attempt failed with "certificate has expired". Not sure which certificate has expired. Is your system's clock set correctly (taking a guess)?

@sumanth-lingappa
Copy link

@chrmarti, yes the system clock is correct.

@chrmarti
Copy link
Collaborator

chrmarti commented May 9, 2023

@sumanth-lingappa Could you use F1 > Network Proxy Test: Show OS Certificates and check if that has the same "Network Security (iboss Network Security)" entry as we have seen above? Please post it here if it is different.

@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests