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

Missing handling of authentication and xsrf tokens #58

Open
minrk opened this issue Mar 26, 2024 · 0 comments
Open

Missing handling of authentication and xsrf tokens #58

minrk opened this issue Mar 26, 2024 · 0 comments

Comments

@minrk
Copy link

minrk commented Mar 26, 2024

The current use of $.ajax is resulting in incorrect handling of authentication and XSRF tokens.

The JupyterLab ServerConnection object has a makeRequest method that will make sure to add all the necessary credentials to requests to the server. It would probably be more reliable to use ServerConnection.makeRequest to talk to the server. This does have the requirement that the requests go to the notebook server, I'm not sure if the gallery is sometimes (or usually!) somewhere else, in which case you'd have to duplicate some of makeRequest's behavior (for requests to the server). Specifically, this bit where authentication information is added to the request.

I do see use of makeRequest in environment-registration, so maybe it can be used everywhere (or at least everywhere you talk to the Jupyter server).

The lack of XSRF implementation has led some users of nbgallery to disable all XSRF protections.

cc @cccs-nik

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

No branches or pull requests

1 participant