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

API to Set-Cookie for external web request handlers #3224

Open
consideRatio opened this issue Oct 26, 2020 · 0 comments
Open

API to Set-Cookie for external web request handlers #3224

consideRatio opened this issue Oct 26, 2020 · 0 comments

Comments

@consideRatio
Copy link
Member

consideRatio commented Oct 26, 2020

Proposed change

To expose an API that can be used for example by OAuthenticator to get JupyterHub's help to set a cookie associated with responses part of the authentication flow. This is relevant because JupyterHub has a cookie_options configuration that should be allowed to influence cookies set by libraries integrating with JupyterHub like OAuthenticator.

Background understanding

It is my understanding that jupyterhub/oauthenticator registers additional web request handlers for endpoints that JupyterHub will start listening to, and it does this by setting login_handler and callback_handler on the JupyterHub Authenticator base class.

It is my understanding that as part of handling web requests to these endpoints, OAuthenticator wants to set cookies (respond with a Set-Cookie HTTP header). This issue regards how to get that done, and the aim to get this done without relying on private methods in JupyterHub.

Alternative options

To use JupyterHub internal functions which may be changing without notice for example.

Motivation

This was suggested by @minrk in jupyterhub/oauthenticator#378 (comment), and I think the key point is to ensure that usage of JupyterHub to set cookies is to be more robust by integrated Python libraries than using a private function like _set_cookie in the BaseHandler class.

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

1 participant