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

Can we initialise oauth_client when initialise JupyterLab, to support the case that Jupyter Api called when server not yet spawned #4786

Closed
linlol opened this issue Apr 15, 2024 · 3 comments

Comments

@linlol
Copy link

linlol commented Apr 15, 2024

Hi team, I use JupyterHub in k8s with our internal OAuth

In my case, I developed an GET API (denoted as /base_url/sample) protected via @tornado.web.authenticate which is supposed to be called directly from browser

Behaviour would be tricky if jupyterLab pod isn't yet spawned, the behaviour would be like this.

  1. Hub noticed that server/pod is not yet spawned, thus redirect user to hub's home page /${prefix}/hub/home
  2. User select correct profile to spawn server
  3. After spawn, user would be redirected to /base_url/sample with 403 error, the reason is that user is redirect but /oauth_callback is not yet requested, thus, user's oauth_client_id is not yet set in cookie

Is there any workarounds to avoid this behaviour with proper protection?

Copy link

welcome bot commented Apr 15, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@minrk
Copy link
Member

minrk commented May 3, 2024

Can you share the actual 403 error and more of how the service is setup? If a page is decorated with @web.authenticated, it will redirect through OAuth by default instead of stopping at 403. At least if it's using JupyterHub's HubOAuthenticated mixin.

@linlol
Copy link
Author

linlol commented May 16, 2024

@minrk thanks for sharing that and sorry for late response...

Yes I would have a further look at customisation on our end, let's may close it first

@linlol linlol closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants