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

Use password in URL to login similar as in jupyter notebook servers #6734

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

benjaminum
Copy link

Fixes #6733

This change allows passing the password in the URL to code-server to allow automatic login similar to the token in jupyter notebook servers.

We can use the following snippet to create the URL and launch code-server.

local password=$(openssl rand -hex 32)
echo http://$(hostname -f):8080/login?session_password=$password
PASSWORD=$password /path/to/code-server/bin/code-server --bind-addr 0.0.0.0:8080

Clicking on this link printed to the terminal by the above code will login the user to code-server without any interaction.

http://mycomputer.com:8080/login?session_password=fbf7cc58bbd90a9f172490f5c57201e03ca967efe424090c872b3218110f29fa

@benjaminum benjaminum requested a review from a team as a code owner March 30, 2024 06:36
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

I think we should do this on the backend rather than relying on automatically filling the form on the frontend.

If the password is in the query parameters, then we check it, if it matches then we set the cookie. We could also redirect to strip out the session_password query variable so it does not persist in the URL (otherwise someone could potentially read it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow login with token similar to jupyter notebook server
2 participants