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

[placeholder] Export a token or a cookie #647

Closed
tcompa opened this issue Nov 19, 2024 · 7 comments · Fixed by #652
Closed

[placeholder] Export a token or a cookie #647

tcompa opened this issue Nov 19, 2024 · 7 comments · Fixed by #652

Comments

@tcompa
Copy link
Collaborator

tcompa commented Nov 19, 2024

High-level: sooner or later, we may want to access data served through fractal-vizarr-viewer from a command-line application.
Fractal-web would be the right place to export the required piece of information required for authentication.

This is related to:


We should review what's the best approach among:

  1. Expose a simple way to download the key/value pair of the fastapiusersauth cookie, from an authenticated fractal-web session. The current way is to open the browser developer tools and copy the cookie string, but we may want to simply expose it in the top-right user options.
  2. Switch from cookie to tokens? Does it make sense? We would need to support them in fractal-vizarr-viewer. I've not thought carefully about this yet - TBD
@zonia3000
Copy link
Collaborator

  1. Switch from cookie to tokens? Does it make sense? We would need to support them in fractal-vizarr-viewer.

While the cookie is automatically sent by the browser (based on the domain of the HTTP request), the token needs to be explicitly added by JavaScript when performing the request. This means that we would need to edit not only vizarr, but also zarrita.js, to add the token into the header.

@zonia3000
Copy link
Collaborator

After discussion with @tcompa: in fractal-vizarr-viewer backend we can support both the token and the cookie, so that vizarr can work with the cookies handled automatically by the browser and fractal-web can expose a "download token" button, which provides a token file that can be used from command line.

@tcompa
Copy link
Collaborator Author

tcompa commented Nov 21, 2024

Current plan:

@zonia3000
Copy link
Collaborator

Where should we put this? On the user menu on the right?

image

@tcompa
Copy link
Collaborator Author

tcompa commented Nov 21, 2024

Where should we put this? On the user menu on the right?

Maybe within "My profile"? No strong opinions..

@zonia3000
Copy link
Collaborator

image

@jluethi
Copy link
Collaborator

jluethi commented Nov 24, 2024

Coming to this delayed. Great that the token part is working out. We can have it on the "My profile" page for now. If we start to use it more regularly, I did like @zonia3000 initial suggestion of putting it into the user menu directly. But let's first see where this gets used :)

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