Skip to content

Automatically close login webpage or redirect back to the web ide, or just give a notification #97

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

Open
ParticleG opened this issue Mar 11, 2025 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@ParticleG
Copy link
Contributor

Currently there's no notification indicates that user is logged in (authorized), neither having any automatic way to close login page or redirect to web ide.

@msujew
Copy link
Contributor

msujew commented Mar 11, 2025

Quite funny, we we're literally just talking about that feature in the team. I'll assign this to the respective contributor :)

@msujew msujew added the enhancement New feature or request label Mar 11, 2025
@ParticleG
Copy link
Contributor Author

ParticleG commented Mar 12, 2025

Should be quite easy to implement :)
For example, oct vscode extension could use vscode.env.uiKind to detect current running environment and pass it to login api, login.html could use this to show a notification about login success then autoclose shortly when in web environment, or show You could close this page now page content when in desktop environment

@jonah-iden
Copy link
Contributor

Hi, maybe I don't fully understand your usecase here, but there is already a way to redirect back to the ide. At least for the oauth endpoints you can add a redirect parameter to get redirected to on success. Or is this about the simple login? Because there you are correct. Here we are still missing some redirect or notification on browser side. In the IDE though, there should be a notification that the session has been created.

@jonah-iden
Copy link
Contributor

thinking more about this. One thing that would be nice could be to have a full login flow without having to open a new tab or popup. So that at the end you would be redirected back to the webide with the login token as url search paramter. So the application could then when the token paramter is available just send the login successful check request once and then have the user info available to create or join a session.
The problem here would just be, that if the login process was triggerd by the user trying to join or create a session while not authenticated yet, the join/create process would not finish after getting back to the website, except of course if the website saves this information somehow to continue it after the user has been authenticated

@msujew
Copy link
Contributor

msujew commented Mar 12, 2025

@jonah-iden I've also recently thought that we could improve the login quite a bit - for example, the whole unverified/anonymous login flow can be done without leaving VS Code, just by entering data into the quick pick. Other providers would still require users to leave VS Code and open a browser, but that could redirect to the vscode:// URI again (or whatever VS Code is using for desktop URI access).

@jonah-iden
Copy link
Contributor

@msujew the problem with showing a quick pick is that most of the configuration on how to do the login is currently on server side. We would need some way from the server to request login methods. But that would then make the whole login flow more complicated. So

  • the client would first request the possible authentication options,
  • then send a request to the server with the choice, to somehow get instructions on how to handle this back.
  • then follow the instruction. however they may look

@msujew
Copy link
Contributor

msujew commented Mar 12, 2025

@jonah-iden I would argue that, since the anonymous login is essentially hardcoded into the server, we could have special handling for it, whereas everything else just delegates to the browser. That should be manageable, right?

@jonah-iden
Copy link
Contributor

@msujew you would need to check in the client if it is enabled in the server and then offer the user a choice if other methods are available. Currently this choosing is basicly handled by the https://www.open-collab.tools/login/ website

@ParticleG
Copy link
Contributor Author

ParticleG commented Mar 13, 2025

Hi, maybe I don't fully understand your usecase here, but there is already a way to redirect back to the ide. At least for the oauth endpoints you can add a redirect parameter to get redirected to on success. Or is this about the simple login? Because there you are correct. Here we are still missing some redirect or notification on browser side. In the IDE though, there should be a notification that the session has been created.

Yes, this is about simple login. Or can I use custom OAuth in offline deployment of oct-server? I mean current simple login in self-deploy environment would just leave user in the login web page after they clicked login button, no notification, no autoclose or redirect back.

@jonah-iden
Copy link
Contributor

@ParticleG ah ok, thanks for the explanation. You are using the vscode extension right?
I created a draft PR which will allow the extension to do all of the simple login through quickpicks inside of vscode instead of having to open a website.
Another option is to use your own website which then could have the ability to redirect to somewhere. But maybe i should also add a simple message to the current default simple login website provided by the oct server

@ParticleG
Copy link
Contributor Author

ParticleG commented Mar 13, 2025

@ParticleG ah ok, thanks for the explanation. You are using the vscode extension right? I created a draft PR which will allow the extension to do all of the simple login through quickpicks inside of vscode instead of having to open a website. Another option is to use your own website which then could have the ability to redirect to somewhere. But maybe i should also add a simple message to the current default simple login website provided by the oct server

Yes, I'm using the vscode extension in the code server (A web-based vscode compatible IDE) in a docker container.

Thanks for making the PR. Using quick picks and ensuring all simple login steps are within the vscode is good. Allowing users to use a custom website is also appreciated.

Adding a simple message to the current default simple login website sounds essential to me. We could also call window.close() a few seconds after the login success message has been displayed.

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

No branches or pull requests

3 participants