microsoft / vscode

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

Source control have to CONSTANTLY log in #217667

Open Sof2222 opened 4 days ago

Sof2222 commented 4 days ago

Type: Bug

Hi! since the last update I have to constantly be reauthenticating git by using gh auth login in the terminal in order for changes to sync to the repo. Have not had this issue before the most recent update but it is very infuriating and time consuming... I should not have to do this every 5 minutes when I need to sync it.

VS Code version: Code 1.90.2 (5437499feb04f7a586f677b155b039bc2b3669eb, 2024-06-18T22:54:35.075Z) OS version: Darwin arm64 23.4.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M2 (8 x 2400)| |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
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|3, 3, 3| |Memory (System)|24.00GB (0.07GB free)| |Process Argv|--crash-reporter-id 9a4d3e2f-7c10-446b-ba17-bf59a9425bde| |Screen Reader|no| |VM|0%|
Extensions (41) Extension|Author (truncated)|Version ---|---|--- arepl|alm|2.0.5 vscode-tailwindcss|bra|0.10.5 vscode-deno|den|3.37.1 es7-react-js-snippets|dsz|4.4.3 prettier-vscode|esb|10.4.0 codespaces|Git|1.16.23 copilot|Git|1.206.0 copilot-chat|Git|0.16.1 vscode-github-actions|git|0.26.3 live-sass|gle|6.1.2 ai-docstring|gra|0.1.3 vsc-python-indent|Kev|1.18.0 vscode-latex|mat|1.3.0 vscode-docker|ms-|1.29.1 anaconda-extension-pack|ms-|1.0.1 debugpy|ms-|2024.6.0 isort|ms-|2023.10.1 pylint|ms-|2023.10.1 python|ms-|2024.8.1 vscode-pylance|ms-|2024.6.1 jupyter|ms-|2024.5.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.18 vscode-jupyter-cell-tags|ms-|0.1.9 vscode-jupyter-slideshow|ms-|0.1.6 remote-containers|ms-|0.369.0 remote-ssh|ms-|0.112.0 remote-ssh-edit|ms-|0.86.0 cpptools|ms-|1.20.5 remote-explorer|ms-|0.4.3 vscode-typescript-next|ms-|5.6.20240622 postman-for-vscode|Pos|1.0.3 prisma|Pri|5.15.0 nextjs-snippets|Pul|1.0.2 vscode-yaml|red|1.15.0 adobe-script-runner|ren|0.6.0 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-icons|vsc|12.8.0 vscode-import-cost|wix|3.3.0 livecode|xir|1.3.10
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 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 jchc7451:31067544 showvideoc:31016891 chatpanelc:31048052 dsvsc021:30996838 0ee40948:31013168 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 legacy_priority:31077528 ```
lszomoru commented 3 days ago

@TylerLeonhardt, were there any GH auth related changes in the latest release?

TylerLeonhardt commented 3 days ago

I have to constantly be reauthenticating git by using gh auth login

This seems like an issue related to the gh CLI?... @Sof2222 do you see this when syncing your git repo from a terminal outside of VS Code?

@lszomoru remind me the order of operations... if gh is auth'd properly, I assume that will be used over the auth state in VS Code?

lszomoru commented 2 days ago

VS Code always sits at the end of the auth pipeline so if there are any auth providers configured (ex: git credential manager) the will be honoured. If the auth request reaches VS Code, and is hosted on GitHub, the vscode.github extension implements a credential provider that will just use the github-authentication extension to get a token and use that for the git operation.

@Sof2222, do you mind providing a screenshot of the login prompt that you see for a git operation? Thanks!

Sof2222 commented 2 days ago

Hi!

Sorry for the late replies here, was out yesterday.

I actually have 2 github accounts - this one which has copilot access and another one which has repo access.

I have had this issue here for a while: https://github.com/orgs/community/discussions/58082#discussioncomment-9856274

It is progressivly getting worse it seems though.

So this account is logged into github as it needs to be in order for copilot to work. The other account however is what I need to use to push to the repo. It used to be I could be logged into both accounts but maybe half a year ago something changed and I was no longer able to be logged into both in vs code itself and it was either 'one or the other' - so either this one was 'active' for all or the other one was active for all.

I found a workaround by logging in with gh auth login with the one I wanted to push to github - only had to redo this when I restarted my computer at that stage.

Since I updated vs code very recently however, I have been constantly (like i have to fill it in twice and it is asking near constantly) the 'git-credential-osxkeychain wants to access key "github.com" in your keychain' (adding as an attachment). Perhaps there is an issue there - (note I have not updated my OS or anything else within the last few months)

I think it is accessing the one stored on this account (which has copilot but not repo access) so when I go to push, it tells me I have no access. I then have to login again with gh auth login before it pushes through to the repo. (but then it pops up asking for the keychain access again)

Am unsure if my flow is the most ideal, but its what I figured out to work for me (I use the source control tab to push to git)

Screenshot 2024-06-27 at 10 58 09 AM

I am guessing that it is constantly asking for the keychain is overriding gh auth login? But yet again - I am not sure at all about the backend of how git works (am no expert there, just using it)