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

17 Replies
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)
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#L22I will give that a try and report back
any good luck? iam kinda having the same issue, wants github login / profiles
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.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.
@sharkymark GitHub Copilot was open-sourced and modified recently to allow OSS versions of VSCode
that's good news
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
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.
@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 thatI 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.well I think that if you
gh login
it might pick that up, though i am not sure of the OAuth scopes are the sameI 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 tooI 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?i think we need to upodate the vscode-web module to use the coder CLI
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 :-)