Live-share: [VS Code] The user code is invalid or expired. Try signing in again.

Created on 13 Aug 2019  ·  26Comments  ·  Source: MicrosoftDocs/live-share


Error:
The user code is invalid or expired. Try signing in again.

Steps to Reproduce:

  1. Clicked Live Share button in status bar.
  2. Signed into Github account and authorized.
  3. Github redirects to screen that says Signed In and tells me to go back to my VS Code editor.
  4. VS Code editor hangs on "Signing in".
  5. I go back to webpage and try the PIN option.
  6. After copying and pasting the PIN from the web page, I get the message that the PIN is invalid or expired.

||Version Data|
|-:|:-|
|extensionName|VSLS|
|extensionVersion|1.0.657|
|protocolVersion|2.2|
|applicationName|VSCode|
|applicationVersion|1.37.0|
|platformName|Linux|
|platformVersion|4.15.0-55-generic|

Most helpful comment

Closing with workaround suggested in #3012

Sorry @BrunoGuardia but workaround is not a solution.

All 26 comments

@legomushroom , can you take a look at the logs?

@joeynguyen thanks for the feedback! The User Code is valid for 2 minutes and 1 use. Did you recall using it twice or trying to use it after 2 minutes from its generation?

Nope! I used it only once and immediately after I got it.

I'll also add that both VS Code and the browser I was using are in an Ubuntu Virtualbox VM. Not sure if that matters. I confirmed that the time inside the VM matched the Window host computer's time.

Thanks for taking a look!

I am having same issue with Ubuntu. I sign in through Github and go through the whole process, close the window, and VS code hangs on "Starting collaboration session: Signing In". I have also used the manual code each time and doesn't bypass the issue.

Same problem here.

I have the same issue inside VS Code with Remote - WSL inside WSL 2

I'm having this issue as well.
VSLS: 1.0.1615
VS Code: 1.42.1
Platform: macOS 10.14.6
Browser redirects as expected, but error is shown. Have tried generating manual PIN for sign-in as well.

same here on linux

edit. restarting my computer solved the problem.

Restart did not solve the problem for me 🤷‍♂️

Also having this issue on Linux, restarting has not resolved the problem.

Same for me, Ubuntu 16.04. Restart did not fix it.

For those having this issue: This is persisting in a bunch of systems. For example, in my installs in Windows 10 and Debian 10, with shared or different configs, even clean installs, it persisted.

The only workaround I got around it for now was directly signing in here and using the user code in VS Code, without trying to log in inside the editor. the normal way to log in is non-functional.

After trying to sign in with the user code I see a little pin/person thing in the status bar. Clicking it pops up the message "Cannot read property 'userName' of undefined
Source: Live Share (Extension)"

Now I also see the message "Cannot read property 'userName' of undefined"

We have a bunch of Win10s with that problem here. Are there any logs we could provide to narrow down the problem?

I have the same issue, also willing to assist with any logs if it can help solve the problem.

I'm on Mac 10.15, and everyone we have trying to use this is also getting this problem. I've also tried disabling Live Share authentication so we get a code back instead of being asked to open our vscode, but entering that code results in the same error.

Same issue on Ubuntu 18.04.4 VS Code 1.44.2

Yes. And the same issue when I pass code manually.

The suggested fix in issue #3012: Stuck on sign in after signing in with Microsoft or GitHub account. worked for me.

For everyone still experiencing sign in issues with Live Share in Visual Studio Code, please try to run Live Share: Disable VSCode account authentication in your command palette. That will change the authentication flow to the legacy one which is still being supported.

Caveat: I also had to remove a VS URL from my proxy bypass config (within an application external to VS code) that I had added during earlier troubleshooting: vsengsaas.visualstudio.com. Most folks probably don't have this URL in their proxy bypass config, but if you do, remove it and then run the above command within VS Code.

Thanks @geraldfullam that worked for me.

Closing with workaround suggested in #3012

Closing with workaround suggested in #3012

Sorry @BrunoGuardia but workaround is not a solution.

Was this page helpful?
0 / 5 - 0 ratings