OSC / ondemand

Supercomputing. Seamlessly. Open, Interactive HPC Via the Web
https://openondemand.org/
MIT License
283 stars 106 forks source link

Support page reloads for noVNC sessions #500

Open msquee opened 4 years ago

msquee commented 4 years ago

The OOD installation of noVNC uses the password field in URL query parameters to authenticate itself. The password can only be used once. If users perform a page reload they won't be able to resume their session immediately, they have to go back to their interactive sessions list in OOD and relaunch the noVNC interface.

Proposed Solution: Since we can easily build out custom components in noVNC now (#428) we should add HTTP long polling to noVNC.html just like the OOD dashboard does and update the password query parameter automatically.

let url = new URL(window.location.origin + window.location.search)
url.searchParams.set('password', 'newPassword')

References:

┆Issue is synchronized with this Asana task by Unito

msquee commented 4 years ago

Browser support for URL is good: https://caniuse.com/#feat=url

ericfranz commented 4 years ago

A polling solution wouldn't be required here. If the password changes after you connect via noVNC, you would only have to fetch the updated password one time on the noVNC page - after successfully connecting.

Instead of modifying noVNC to address this issue, a proper authentication abstraction may solve this problem in a different way - by eliminating the need for a password, or for the password to change during every connection.