question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot sign in to Github account

See original GitHub issue

Cannot sign in to Github. When I click on “Clone repository” under SCM tab and provide the repo url and folder, it asks me to sign in to Github. The authorization page opens in a new tab: image

After clicking on “Continue”, the following error occurs: image

I tried to generate “Personal Access Token” on Github, then entered that here: image

This did not work either.

  • Web Browser: Microsoft Egde (Chromium)
  • Local OS: Windows 10
  • Remote OS: Ubuntu 18.04.3 (LTS)
  • Remote Architecture: x64
  • code-server --version: 3.4.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:23 (4 by maintainers)

github_iconTop GitHub Comments

48reactions
jinexists-oldaccountcommented, Jul 17, 2020

I had the same issue and was able to figure out a solution. I took the url that a regular instance of VSCode spits out and used it to reverse engineer how the url is put together.

A auth url from code-server looks like this: https://vscode-auth.github.com/authorize/?callbackUri=https://example.com/callback%3Fvscode-requestId%xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%26vscode-scheme%3Dcode-oss%26vscode-authority%3Dvscode.github-authentication%26vscode-path%3D%252Fdid-authenticate&scope=repo&state=state-from-code-server&responseType=code

What I did was take the state parameter at the end of the auth url given by code-server and insert it into the url below which is derived from the url a normal version of VSCode spits out.

A final url will look like this: https://vscode-auth.github.com/authorize/?callbackUri=vscode://vscode.github-authentication/did-authenticate&scope=repo&state=insert-state-from-code-server-here&responseType=code

After going to the page you will get an auth token that looks something like this: vscode://vscode.github-authentication/did-authenticate?code=secretcode&state=magicstate

Then, back in code-server you can click signing into github.com in the task bar and paste the auth token.

Hope this helps!

4reactions
garyhtoucommented, Sep 11, 2020

I had the same issue and was able to figure out a solution. I took the url that a regular instance of VSCode spits out and used it to reverse engineer how the url is put together.

A auth url from code-server looks like this: https://vscode-auth.github.com/authorize/?callbackUri=https://example.com/callback%3Fvscode-requestId%xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%26vscode-scheme%3Dcode-oss%26vscode-authority%3Dvscode.github-authentication%26vscode-path%3D%252Fdid-authenticate&scope=repo&state=state-from-code-server&responseType=code

What I did was take the state parameter at the end of the auth url given by code-server and insert it into the url below which is derived from the url a normal version of VSCode spits out.

A final url will look like this: https://vscode-auth.github.com/authorize/?callbackUri=vscode://vscode.github-authentication/did-authenticate&scope=repo&state=insert-state-from-code-server-here&responseType=code

After going to the page you will get an auth token that looks something like this: vscode://vscode.github-authentication/did-authenticate?code=secretcode&state=magicstate

Then, back in code-server you can click signing into github.com in the task bar and paste the auth token.

Hope this helps!

It gave me Sign in failed: Error: network error

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authenticating to GitHub - GitHub Docs
Authenticating an account on GitHub · Use the File menu, then click Options. · In the Options window, select Accounts. · To the...
Read more >
Unable to login to GitHub account even with correct credentials
I am unable to login to my GitHub account even with the correct username and password. They keeps telling me that username or...
Read more >
Cannot log in to my GitHub account - Atlassian Community
Solved: I recently changed my username on my Github account, and now I can't seem to connect to my account from SourceTree. I...
Read more >
Signing in to Visual Studio subscriptions with your GitHub ...
A: You can recover your GitHub account by going to Reset your password. Or, you can recover your GitHub-linked Microsoft account by entering ......
Read more >
GitHub Sign-In Not Working - Visual Studio Feedback
I am trying to sign in using my GitHub account, however, I received a script error when I attempt to connect to GitHub....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found