diff --git a/jupyter/base/values/values.yaml b/jupyter/base/values/values.yaml index 9a49a2a..d6a82a5 100644 --- a/jupyter/base/values/values.yaml +++ b/jupyter/base/values/values.yaml @@ -107,9 +107,26 @@ hub: c.NextcloudOAuthenticator.allow_all = True c.NextcloudOAuthenticator.refresh_pre_spawn = True c.NextcloudOAuthenticator.enable_auth_state = True - c.NextcloudOAuthenticator.auth_refresh_age = 60 + c.NextcloudOAuthenticator.auth_refresh_age = 3600 c.NextcloudOAuthenticator.post_auth_hook = post_auth_hook + serviceCode: | + from jupyter_server.base.handlers import JupyterHandler + import tornado + + + class MyExtensionHandler(JupyterHandler): + @tornado.web.authenticated + def get(self): + print("Hello World") + + def _load_jupyter_server_extension(serverapp: jupyter_server.serverapp.ServerApp): + """ + This function is called when the extension is loaded. + """ + handlers = [("/nextcloud/token", NextcloudExtensionHandler)] + serverapp.web_app.add_handlers(".*$", handlers) + extraEnv: NEXTCLOUD_DEBUG_OAUTH: "yes" NEXTCLOUD_HOST: sunet.drive.test.sunet.se