Persistent GitHub Authentication for Copilot in Coder VS Code Web

Hi Coder Team, I'm using the Coder platform with the VS Code Web module and GitHub Copilot. Currently, every time I refresh the browser or open a new workspace, I'm prompted to log in to GitHub again to access Copilot. This is disruptive, especially when managing multiple personal workspaces. Is there a way to persist the GitHub authentication across sessions and workspaces? Ideally, I’d like to either: Save the authentication token so I don't need to log in repeatedly, or Set up a preconfigured authentication as part of the workspace template so each new workspace is already authenticated. Any guidance on how to achieve this would be greatly appreciated. Thanks
No description
17 Replies
sharkymark
sharkymark5mo ago
I noticed that as well and figured it's a function of an HTTP session but would have hoped a cookie or something would have persisted it. I'm back to VS Code Desktop for now connecting to the workspace (which does persist)
Phorcys
Phorcys4mo ago
hey, I don't think that we can do something about the persisting side of things. VS Code Web stores its settings in the browser session on a per-domain basis, meaning that each workspace will have different settings. code-server stores config to the disk but doesn't have Microsoft/GitHub login because it's based on Code OSS you could try logging in to the gh CLI through external auth and see if it picks that up but i'm unsure https://github.com/matifali/dotfiles/blob/f439c552682a34099b0f847a5dfd234a0021f6f0/.zshrc#L22
Jason Overmier
Jason OvermierOP4mo ago
I will give that a try and report back
ei.do
ei.do4mo ago
any good luck? iam kinda having the same issue, wants github login / profiles
Jason Overmier
Jason OvermierOP4mo ago
I got sidetracked trying to get envbox working with vscode-web and code-server. Once I get past this missing /tmp/code-script-data directory issue I think I will be able to switch back to working on this feature. Hopefully later today I will have it tested. I was able to get copilot chat to work in code-server last week by having both code-server and vscode-web share the same extensions. It looks like the most recent update of copilot breaks this with the current version of code-server. Most likely code-server will have to pull in the changes made in vscode-web. I was able to get github cli authenticated using the github token. This token doesn't seem to be shared with either vscode-web nor code-server. Github PAT only seems to work with managing repos and isn't used for copilot authorization. I currently haven't found a way to have github copilot authenticated without manually going through the login step. I did notice that when copilot was working in code-server I only had to log in once. Each time I closed and came back the authentication persisted.
sharkymark
sharkymark4mo ago
Coder's code-server worked after one login of Copilot? I recall a couple years ago, we had a customer request for this and that is probably why it works. But you had to use other means to get the Copilot extension in Coder's code-server since the Microsoft marketplace is not accessible.
Phorcys
Phorcys4mo ago
@sharkymark GitHub Copilot was open-sourced and modified recently to allow OSS versions of VSCode
sharkymark
sharkymark4mo ago
that's good news
Phorcys
Phorcys4mo ago
copilot uses the oauth or device flow to log in hence why the PAT doesn't work i'll try to reproduce this on my end, apologies for the delays
Jason Overmier
Jason OvermierOP4mo ago
Great thank you looking into this. I was about to switch to codespaces but if we can get this working I would like to use coder instead.
Phorcys
Phorcys3mo ago
@Jason Overmier quick thought, have you tried logging in through the gh CLI and seeing if the extension picks that up? the issue is that it uses VSCode's built-in extension store and i'm not really sure on how to leverage that
Jason Overmier
Jason OvermierOP3mo ago
I have gh cli installed have tried going down that path a little. I can't remember why I gave up on that approach. I can look into it again if you think that might work.
Phorcys
Phorcys3mo ago
well I think that if you gh login it might pick that up, though i am not sure of the OAuth scopes are the same
matifali
matifali3mo ago
I think it has to do with how we install VSCode web. We download the Microsoft code-server and run coder-server serve-local which doesn't persist the session. I remember seeing somewhere that if you change it to code serve-web it can persist sessions. If someone can verify this, we can update the module too
Jason Overmier
Jason OvermierOP3mo ago
I have the latest gh cli installed and am logged in. vscode-web does not pick up the gh account. The UI still shows I have to sign in to access copilot. What also sucks is the github copilot extension > 0.27.0 won't show up in the code-server UI. Is there some way I can help you verify this?
matifali
matifali3mo ago
i think we need to upodate the vscode-web module to use the coder CLI
Phorcys
Phorcys3mo ago
hey, updating you on this, the last weeks have been very busy for me, and this week will be too so there is a lot of backlog that has built up so I apologize for the delay! If no one else from the team has had the time to figure this out I should be able to catch up with all open issues by next week EOW, I will try to leave an answer, even if it is an "i don't know" just so you know we're looking at this! thanks for your understanding :-)

Did you find this page helpful?