Home > OS >  Visual Studio Code - Authentication Error
Visual Studio Code - Authentication Error

Time:03-23

I am using VSCode and started getting the following error when launching VSCode:

You have been signed out because reading stored authentication information failed.

I checked the "Microsoft Authentication" output and see the following being logged:

[Info  - 12:53:11.944] Reading sessions from secret storage...
[Info  - 12:53:12.8] Got 2 stored sessions
[Trace  - 12:53:12.8] Read the following stored session with scopes: email offline_access openid profile
[Info  - 12:53:12.8] Refreshing token for scopes: email offline_access openid profile
[Trace  - 12:53:12.9] Read the following stored session with scopes: email offline_access openid profile
[Info  - 12:53:12.9] Refreshing token for scopes: email offline_access openid profile
[Error  - 12:53:12.381] Refreshing token failed (for scopes: email offline_access openid profile): {"error":"invalid_grant","error_description":"AADSTS50173: The provided grant has expired due to it being revoked, a fresh auth token is needed. The user might have changed or reset their password. The grant was issued on '2022-01-18T01:28:57.1010000Z' and the TokensValidFrom date (before which tokens are not valid) for this user is '2022-03-17T00:24:27.0000000Z'.\r\nTrace ID: 61f7c850-e661-4df6-804d-b09ac98a4300\r\nCorrelation ID: 52be35ff-e99b-4b53-9dbb-2dba8582d605\r\nTimestamp: 2022-03-21 12:53:12Z","error_codes":[50173],"timestamp":"2022-03-21 12:53:12Z","trace_id":"61f7c850-e661-4df6-804d-b09ac98a4300","correlation_id":"52be35ff-e99b-4b53-9dbb-2dba8582d605","error_uri":"https://login.microsoftonline.com/error?code=50173"}
[Error  - 12:53:12.382] Error: Refreshing token failed
[Info  - 12:53:12.382] Logging out of session 'f140c6a2-c524-4206-9a98-2b24b0c5a952/3046af31-b03b-4dec-ac69-5e441c677bfa/cdcd3466-2921-45ce-b841-62e6f5e4151a'
[Info  - 12:53:12.382] Session not found 'f140c6a2-c524-4206-9a98-2b24b0c5a952/3046af31-b03b-4dec-ac69-5e441c677bfa/cdcd3466-2921-45ce-b841-62e6f5e4151a'
[Info  - 12:53:12.423] Setting token for scopes: email offline_access openid profile
[Info  - 12:53:12.423] Token refresh success for scopes: email offline_access openid profile
[Info  - 12:53:12.425] Getting sessions for the following scopes: email offline_access openid profile
[Info  - 12:53:12.425] Got 1 sessions for scopes: email offline_access openid profile
[Info  - 12:53:12.425] Token available from cache (for scopes email offline_access openid profile), expires in 3756998 milliseconds

I do not recall having to log into any Microsoft environment to use VSCode, and not sure how to check or reset password to resolve this.

VSCode version:

Version: 1.65.2 (user setup)
Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
Date: 2022-03-10T14:33:55.248Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042

CodePudding user response:

This link helped me.

How to fix:

  1. Exit Visual Studio Code application
  2. Open: Credential Manager ("Start → Settings" → then search for "Credential Manager")
  3. Click on the Windows Credentials tab.
  4. Remove all credentials start with vscode.vscode, git:, ada:
  5. Open Visual Studio Code application and login again. Done

enter image description here vscode-fix-you-have-been-signed-out-because...

  • Related