vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Serial Github authentication requests pile up

Open digitarald opened this issue 3 years ago • 1 comments

Type: Bug

I just restarted Insiders and had to click through 4 GitHub auth requests.

  1. Actions put up a dialog, requiring me to sign in.
  2. Copilot used a notification
  3. GHPRI out a badge on the user icon
  4. Settings Sync was also logged out, notifying me with another badge

The first 3 opened GitHub and required me to re-check the orgs that the token has access to. Only Copilot provided feedback that the web flow succeeded, others silently accepted the auth.

As users get more GitHub extensions, this will become worse. How can we make those auth requests happen a) less often, b) more controlled and, c) with less clicks/context switching.

VS Code version: Code - Insiders 1.75.0-insider (b92894493e6f971a3c71912d823e699d3a05d643, 2022-12-08T05:21:16.099Z) OS version: Darwin x64 22.1.0 Modes: Sandboxed: Yes

GitHub Auth logs

2022-12-08 08:56:26.022 [info] Reading sessions from keychain... 2022-12-08 08:56:26.022 [info] Getting sessions for user:email... 2022-12-08 08:56:26.022 [info] Got 0 sessions for user:email... 2022-12-08 08:56:26.022 [info] Getting sessions for codespace,read:user,repo,user:email... 2022-12-08 08:56:26.022 [info] Got 0 sessions for codespace,read:user,repo,user:email... 2022-12-08 08:56:26.022 [info] Getting sessions for all scopes... 2022-12-08 08:56:26.022 [info] Got 0 sessions for ... 2022-12-08 08:56:26.450 [info] Getting sessions for repo,workflow... 2022-12-08 08:56:26.451 [info] Got 0 sessions for repo,workflow... 2022-12-08 08:56:30.850 [info] Logging in for the following scopes: repo workflow 2022-12-08 08:56:30.933 [info] Trying without local server... (repo workflow) 2022-12-08 08:56:30.933 [info] Getting sessions for read:user... 2022-12-08 08:56:30.933 [info] Got 0 sessions for read:user... 2022-12-08 08:56:30.937 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:30.937 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:31.011 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:56:31.011 [info] Got 0 sessions for read:user,repo,user:email... 2022-12-08 08:56:31.793 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:31.793 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:33.837 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:33.837 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:33.838 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:56:33.838 [info] Got 0 sessions for read:user,repo,user:email... 2022-12-08 08:56:38.610 [info] Exchanging code for token... 2022-12-08 08:56:39.302 [info] Token exchange success! 2022-12-08 08:56:39.304 [info] Getting user info... 2022-12-08 08:56:39.696 [info] Got account info! 2022-12-08 08:56:39.697 [info] Storing 1 sessions... 2022-12-08 08:56:39.864 [info] Reading sessions from keychain... 2022-12-08 08:56:39.864 [info] Stored 1 sessions! 2022-12-08 08:56:39.865 [info] Login success! 2022-12-08 08:56:39.885 [info] Getting sessions for user:email... 2022-12-08 08:56:39.885 [trace] Token acquired from secret storage. 2022-12-08 08:56:39.885 [info] Got stored sessions! 2022-12-08 08:56:39.885 [trace] Read the following session from the keychain with the following scopes: repo workflow 2022-12-08 08:56:39.885 [info] Got 1 verified sessions. 2022-12-08 08:56:39.886 [info] Got 0 sessions for user:email... 2022-12-08 08:56:39.886 [info] Getting sessions for codespace,read:user,repo,user:email... 2022-12-08 08:56:39.886 [info] Got 0 sessions for codespace,read:user,repo,user:email... 2022-12-08 08:56:39.886 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:39.886 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:39.886 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:39.886 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:39.891 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:56:39.891 [info] Got 0 sessions for read:user,repo,user:email... 2022-12-08 08:56:40.143 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:40.143 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:40.144 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:56:40.144 [info] Got 0 sessions for read:user,repo,user:email... 2022-12-08 08:56:41.842 [info] Getting sessions for read:user... 2022-12-08 08:56:41.842 [info] Got 0 sessions for read:user... 2022-12-08 08:56:43.597 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:43.597 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:43.598 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:56:43.598 [info] Got 0 sessions for read:user,repo,user:email... 2022-12-08 08:56:44.303 [info] Logging in for the following scopes: read:user 2022-12-08 08:56:44.303 [info] Trying without local server... (read:user) 2022-12-08 08:56:50.455 [info] Exchanging code for token... 2022-12-08 08:56:50.913 [info] Token exchange success! 2022-12-08 08:56:50.914 [info] Getting user info... 2022-12-08 08:56:51.252 [info] Got account info! 2022-12-08 08:56:51.257 [info] Storing 2 sessions... 2022-12-08 08:56:51.342 [info] Reading sessions from keychain... 2022-12-08 08:56:51.343 [info] Stored 2 sessions! 2022-12-08 08:56:51.343 [info] Login success! 2022-12-08 08:56:51.353 [info] Getting sessions for user:email... 2022-12-08 08:56:51.353 [info] Getting sessions for codespace,read:user,repo,user:email... 2022-12-08 08:56:51.353 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:51.354 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:51.418 [trace] Token acquired from secret storage. 2022-12-08 08:56:51.419 [info] Got stored sessions! 2022-12-08 08:56:51.419 [trace] Read the following session from the keychain with the following scopes: repo workflow 2022-12-08 08:56:51.419 [trace] Read the following session from the keychain with the following scopes: read:user 2022-12-08 08:56:51.419 [info] Got 2 verified sessions. 2022-12-08 08:56:51.419 [info] Got 0 sessions for user:email... 2022-12-08 08:56:51.419 [info] Got 0 sessions for codespace,read:user,repo,user:email... 2022-12-08 08:56:51.419 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:51.419 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:51.420 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:56:51.421 [info] Got 0 sessions for read:user,repo,user:email... 2022-12-08 08:56:52.201 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:52.201 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:56:52.202 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:56:52.202 [info] Got 0 sessions for read:user,repo,user:email... 2022-12-08 08:56:55.915 [info] Getting sessions for all scopes... 2022-12-08 08:56:55.915 [info] Got 2 sessions for ... 2022-12-08 08:56:58.424 [info] Logging in for the following scopes: read:user repo user:email 2022-12-08 08:56:58.425 [info] Trying without local server... (read:user repo user:email) 2022-12-08 08:57:02.785 [info] Exchanging code for token... 2022-12-08 08:57:03.292 [info] Token exchange success! 2022-12-08 08:57:03.294 [info] Getting user info... 2022-12-08 08:57:03.630 [info] Got account info! 2022-12-08 08:57:03.631 [info] Storing 3 sessions... 2022-12-08 08:57:03.687 [info] Reading sessions from keychain... 2022-12-08 08:57:03.688 [info] Stored 3 sessions! 2022-12-08 08:57:03.688 [info] Login success! 2022-12-08 08:57:03.693 [info] Getting sessions for user:email... 2022-12-08 08:57:03.693 [info] Getting sessions for codespace,read:user,repo,user:email... 2022-12-08 08:57:03.694 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:03.694 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:03.695 [trace] Token acquired from secret storage. 2022-12-08 08:57:03.695 [info] Got stored sessions! 2022-12-08 08:57:03.695 [trace] Read the following session from the keychain with the following scopes: repo workflow 2022-12-08 08:57:03.695 [trace] Read the following session from the keychain with the following scopes: read:user 2022-12-08 08:57:03.695 [trace] Read the following session from the keychain with the following scopes: read:user repo user:email 2022-12-08 08:57:03.695 [info] Got 3 verified sessions. 2022-12-08 08:57:03.695 [info] Got 0 sessions for user:email... 2022-12-08 08:57:03.696 [info] Got 0 sessions for codespace,read:user,repo,user:email... 2022-12-08 08:57:03.696 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:03.696 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:03.700 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:57:03.700 [info] Got 1 sessions for read:user,repo,user:email... 2022-12-08 08:57:35.054 [info] Getting sessions for all scopes... 2022-12-08 08:57:35.054 [info] Got 3 sessions for ... 2022-12-08 08:57:38.437 [info] Getting sessions for user:email... 2022-12-08 08:57:38.438 [info] Got 0 sessions for user:email... 2022-12-08 08:57:40.980 [info] Logging in for the following scopes: user:email 2022-12-08 08:57:40.984 [info] Trying without local server... (user:email) 2022-12-08 08:57:45.308 [info] Exchanging code for token... 2022-12-08 08:57:45.743 [info] Token exchange success! 2022-12-08 08:57:45.744 [info] Getting user info... 2022-12-08 08:57:46.028 [info] Got account info! 2022-12-08 08:57:46.028 [info] Storing 4 sessions... 2022-12-08 08:57:46.084 [info] Reading sessions from keychain... 2022-12-08 08:57:46.084 [info] Stored 4 sessions! 2022-12-08 08:57:46.084 [info] Login success! 2022-12-08 08:57:46.086 [info] Getting sessions for user:email... 2022-12-08 08:57:46.088 [info] Getting sessions for user:email... 2022-12-08 08:57:46.089 [info] Getting sessions for codespace,read:user,repo,user:email... 2022-12-08 08:57:46.089 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:46.089 [info] Getting sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:46.090 [trace] Token acquired from secret storage. 2022-12-08 08:57:46.090 [info] Got stored sessions! 2022-12-08 08:57:46.090 [trace] Read the following session from the keychain with the following scopes: repo workflow 2022-12-08 08:57:46.090 [trace] Read the following session from the keychain with the following scopes: read:user 2022-12-08 08:57:46.090 [trace] Read the following session from the keychain with the following scopes: read:user repo user:email 2022-12-08 08:57:46.090 [trace] Read the following session from the keychain with the following scopes: user:email 2022-12-08 08:57:46.090 [info] Got 4 verified sessions. 2022-12-08 08:57:46.090 [info] Got 1 sessions for user:email... 2022-12-08 08:57:46.090 [info] Got 1 sessions for user:email... 2022-12-08 08:57:46.090 [info] Got 0 sessions for codespace,read:user,repo,user:email... 2022-12-08 08:57:46.090 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:46.090 [info] Got 0 sessions for read:user,repo,user:email,workflow... 2022-12-08 08:57:46.093 [info] Getting sessions for read:user,repo,user:email... 2022-12-08 08:57:46.093 [info] Got 1 sessions for read:user,repo,user:email... 2022-12-08 08:57:51.772 [info] Getting sessions for all scopes... 2022-12-08 08:57:51.772 [info] Got 4 sessions for ... 2022-12-08 08:59:59.073 [info] Getting sessions for all scopes... 2022-12-08 08:59:59.073 [info] Got 4 sessions for ... 2022-12-08 09:01:54.977 [info] Getting sessions for all scopes... 2022-12-08 09:01:54.978 [info] Got 4 sessions for ...

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
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) 9, 5, 4
Memory (System) 64.00GB (26.27GB free)
Process Argv --enable-proposed-api donjayamanne.kusto --log trace --crash-reporter-id 4cf0a6f0-aaf8-4da3-9b2b-81f6c639c12b
Screen Reader no
VM 0%

digitarald avatar Dec 08 '22 17:12 digitarald

As users get more GitHub extensions, this will become worse. How can we make those auth requests happen a) less often, b) more controlled and, c) with less clicks/context switching.

The issue you hit is that VS Code had issues reading the secrets stored on your machine. This is talking about something different: number of round trips to the browser.

I think we are doing what we can to make the round trips as small as possible. This is on GitHub to help us. More here https://github.com/microsoft/vscode/issues/164896

TylerLeonhardt avatar Dec 08 '22 17:12 TylerLeonhardt

@TylerLeonhardt with the #169356 landed, should we close this or morph it into "Reduce GH logins required for multiple extensions"?

digitarald avatar Jan 10 '23 21:01 digitarald

Let's close this for now. I don't expect any work on this for the foreseeable future

TylerLeonhardt avatar Jan 10 '23 21:01 TylerLeonhardt