microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.5k stars 28.65k forks source link

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

Open kevinpagliarulo opened 1 week ago

kevinpagliarulo commented 1 week ago

Type: Bug

Signing into Azure with a cross-cloud B2B user is successful. However, once VS Code is closed and re-opened, the following error message pops up:

"You have been signed out because reading stored authentication information failed. Source: Microsoft Account"

The user has to log back in again to access Azure resources.

Expected result: the sign in caches and the user remains signed in between closing and reopening VS Code.

This has been tested in 2 different environments (customer and lab environment) on 2 different PCs.

Steps to reproduce:

  1. Set the Microsoft-sovereign-cloud setting to "USGovernment"
  2. Run Azure: Sign in
  3. Provide organization name (i.e., mylab.onmicrosoft.us)
  4. Enter credentials for commercial user (which was invited as a B2B guest user in the Government tenant)
  5. Successful sign in.
  6. Close and re-open VS Code.
  7. Error reproduced.

image

VS Code version: Code 1.92.2 (fee1edb8d6d72a0ddff41e5f71a671c23ed924b9, 2024-08-14T17:29:30.058Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900X 12-Core Processor (24 x 3700)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|31.93GB (16.23GB free)| |Process Argv|--crash-reporter-id f3cf1822-7623-44ae-83a9-a40438c1e65a| |Screen Reader|no| |VM|0%|
Extensions (6) Extension|Author (truncated)|Version ---|---|--- copilot|Git|1.228.0 copilot-chat|Git|0.18.2 vscode-azureappservice|ms-|0.25.3 vscode-azureresourcegroups|ms-|0.9.4 vscode-azurestorage|ms-|0.16.1 powershell|ms-|2024.2.2
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 0ee40948:31013168 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 impr_priority:31102340 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31111718 wkspc-ranged-c:31125598 ei213698:31121563 aajjf12562cf:31125794 ```
kevinpagliarulo commented 1 week ago

Logs from the Microsoft Sovereign Cloud Authentication log for the repro of the issue.

where tenant 5000b353-9c2a-48a6-a362-ee4a92282390 is my COMMERCIAL tenant and 787145d8-7476-4f8f-b07a-18041e1c5785 is my GOV tenant

2024-09-05 12:44:16.325[trace] [email https://management.core.usgovcloudapi.net/.default offline_access openid profile] '787145d8-7476-4f8f-b07a-18041e1c5785/96984c10-0059-45a7-bb02-fb2f64cd6e9e/9dcaeb65-997e-43a8-bbe3-96e670e7c5f8' Refreshing token

2024-09-05 12:44:16.476 [error] [email https://management.core.usgovcloudapi.net/.default offline_access openid profile] '787145d8-7476-4f8f-b07a-18041e1c5785/96984c10-0059-45a7-bb02-fb2f64cd6e9e/9dcaeb65-997e-43a8-bbe3-96e670e7c5f8' Refreshing token failed: {"error":"invalid_request","error_description":"AADSTS90038: Tenant '5000b353-9c2a-48a6-a362-ee4a92282390' request is being redirected to the National Cloud 'MicrosoftOnline.COM'. Trace ID: 892fac97-bf3f-4d16-be89-36ff2a0f0b00 Correlation ID: bb44ca2f-4d32-4b16-a8fe-fe2d468aa4fe Timestamp: 2024-09-05 16:44:15Z","error_codes":[90038],"timestamp":"2024-09-05 16:44:15Z","trace_id":"892fac97-bf3f-4d16-be89-36ff2a0f0b00","correlation_id":"bb44ca2f-4d32-4b16-a8fe-fe2d468aa4fe"}

2024-09-05 12:44:16.478 [error] Error: {"error":"invalid_request","error_description":"AADSTS90038: Tenant '5000b353-9c2a-48a6-a362-ee4a92282390' request is being redirected to the National Cloud 'MicrosoftOnline.COM'. Trace ID: 892fac97-bf3f-4d16-be89-36ff2a0f0b00 Correlation ID: bb44ca2f-4d32-4b16-a8fe-fe2d468aa4fe Timestamp: 2024-09-05 16:44:15Z","error_codes":[90038],"timestamp":"2024-09-05 16:44:15Z","trace_id":"892fac97-bf3f-4d16-be89-36ff2a0f0b00","correlation_id":"bb44ca2f-4d32-4b16-a8fe-fe2d468aa4fe"} at h.fetchTokenResponse (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\microsoft-authentication\dist\extension.js:1:187092) at processTicksAndRejections (node:internal/process/task_queues:95:5) at h.doRefreshToken (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\microsoft-authentication\dist\extension.js:1:183370) at c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\microsoft-authentication\dist\extension.js:1:172044 at async Promise.allSettled (index 6) at h.initialize (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\microsoft-authentication\dist\extension.js:1:172575) at u (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\microsoft-authentication\dist\extension.js:1:202830) at e.activate (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\microsoft-authentication\dist\extension.js:1:201398) at m.n (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:6409) at m (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:6372) at m.l (c:\Users\kepaglia\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:5829)

2024-09-05 12:44:16.478 [info] [email https://management.core.usgovcloudapi.net/.default offline_access openid profile] '787145d8-7476-4f8f-b07a-18041e1c5785/96984c10-0059-45a7-bb02-fb2f64cd6e9e/9dcaeb65-997e-43a8-bbe3-96e670e7c5f8' Logging out of session

2024-09-05 12:44:16.478 [trace] [email https://management.core.usgovcloudapi.net/.default offline_access openid profile] '787145d8-7476-4f8f-b07a-18041e1c5785/96984c10-0059-45a7-bb02-fb2f64cd6e9e/9dcaeb65-997e-43a8-bbe3-96e670e7c5f8' Sending change event for session that was removed

2024-09-05 12:44:16.479 [info] [email https://management.core.usgovcloudapi.net/.default offline_access openid profile] '787145d8-7476-4f8f-b07a-18041e1c5785/96984c10-0059-45a7-bb02-fb2f64cd6e9e/9dcaeb65-997e-43a8-bbe3-96e670e7c5f8' Logged out of session successfully!

TylerLeonhardt commented 4 days ago

This appears to be fixed in the MSAL implementation .... but there's a weird bug there where URL handlers don't open on Windows.... investigating next week.