Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to open a tunnel with an API token #9132

Closed
jjcasmar opened this issue Oct 25, 2023 · 4 comments
Closed

Allow to open a tunnel with an API token #9132

jjcasmar opened this issue Oct 25, 2023 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster *question Issue represents a question, should be posted to StackOverflow (VS Code) tunnels under-discussion Issue is under discussion for relevance, priority, approach

Comments

@jjcasmar
Copy link

When creating a tunnel in VSCode, it requires to log into github and insert a numeric code. It would be nice if it was possible to use an API token to be able to automate the creation of tunnels.

That way, it would be possible to create a docker image which open a tunnel without user intervention

@connor4312
Copy link
Member

Please check out the code tunnel user login command. You can pass an access token there. Note that the access token would need to be a valid token created by VS Code or the CLI before, or at least under the VS Code app ID.

@connor4312 connor4312 added info-needed Issue requires more information from poster under-discussion Issue is under discussion for relevance, priority, approach labels Oct 27, 2023
@jjcasmar
Copy link
Author

Ill test this, thanks!

@jjcasmar
Copy link
Author

@connor4312 Could you explain how to create the access token?

@connor4312
Copy link
Member

Actually it looks like the dev tunnel CLI is now public. So the way to go is to create a tunnel using the dev tunnels CLI, after signing in with your preferred GH/MSA account, and create a token with the connect, manage, and host permissions on the tunnel. Then it can be hosted with the command code tunnel --tunnel-id=<tunnel.id> --host-token=<token> --name=<preferred-tunnel-name>.

@connor4312 connor4312 added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Oct 30, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster *question Issue represents a question, should be posted to StackOverflow (VS Code) tunnels under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

3 participants