Kubernetes JupyterHub generic.oauthenticator:500内部服务器错误/400 Cookie中缺少OAuth状态

Kubernetes JupyterHub generic.oauthenticator:500内部服务器错误/400 Cookie中缺少OAuth状态,kubernetes,kubernetes-helm,jupyterhub,Kubernetes,Kubernetes Helm,Jupyterhub,我正在创建一个仪表板服务,多个用户可以通过JupyterHub访问多个笔记本服务器。 用户使用单独的身份验证服务登录,一旦进入仪表板,JupyterHub将在中呈现 我在GCP上的Kubernetes集群中托管JupyterHub。以下是myconfig.yaml的相关部分: ... # Changes the Jupyter's notebook headers to allow it to be displayed # inside of an iframe object. c.Jup

我正在创建一个仪表板服务,多个用户可以通过
JupyterHub访问多个笔记本服务器。

用户使用单独的身份验证服务登录,一旦进入仪表板
JupyterHub
将在
中呈现

我在GCP上的
Kubernetes
集群中托管
JupyterHub
。以下是my
config.yaml
的相关部分:

...
 # Changes the Jupyter's notebook headers to allow it to be displayed
 # inside of an iframe object.
 c.JupyterHub.tornado_settings = {
        "headers": {
          "Content-Security-Policy": "default-src *  data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval' 'unsafe-dynamic'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';",
        }
      }
...
auth:
  type: custom
  custom:
    className: oauthenticator.generic.GenericOAuthenticator
    config:
      login_service: "OpenID" 
      client_id: "<client_id>"
      client_secret: "<client_secret>"
我知道它实际上会重定向到身份验证服务器,并且回调是正确的。即使我试图通过仪表板访问,在
中,我仍然会得到:

400 OAuth状态从cookie中丢失

日志:

IwN2YyNzVhNTk0MzM0ZTM5YmIyZTdmZDQzY2U2ZDI3YyIsICJuZXh0X3VybCI6IG51bGx9&session_state=641fb9aca6490d2c3332871d72ee0639b3ed46b8a9f02c363ee8f7bf46f1c989.74e37d534296
cad45421019d1d442153', version='HTTP/1.1', remote_ip='<>')

    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1703, in _execute
        result = await result
      File "/usr/local/lib/python3.6/dist-packages/oauthenticator/oauth2.py", line 213, in get
        user = await self.login_user()
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py", line 699, in login_user
        authenticated = await self.authenticate(data)
      File "/usr/local/lib/python3.6/dist-packages/jupyterhub/auth.py", line 383, in get_authenticated_user
        authenticated = await maybe_future(self.authenticate(handler, data))
      File "/usr/local/lib/python3.6/dist-packages/oauthenticator/generic.py", line 136, in authenticate
        resp_json = json.loads(resp.body.decode('utf8', 'replace'))
      File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
        return _default_decoder.decode(s)
      File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 5 column 1 (char 4)
400 GET /hub/oauth_callback?code=d37de16a855a49dda94fb65c2c2c8ffa&state=eyJzdGF0ZV9pZCI6ICIwN2YyNzVhNTk0MzM0ZTM5Ym
IyZTdmZDQzY2U2ZDI3YyIsICJuZXh0X3VybCI6IG51bGx9&session_state=641fb9aca6490d2c3332871d72ee0639b3ed46b8a9f02c363ee8f7bf46f1c989.74e37d534296cad45421019d1d442153

OAuth state missing from cookies
上下文:我以前使用过Github OAuthenticator类,并在Github中注册了一个OAuth应用程序,并使
JupyterHub
正常工作。然而,Github不允许他们的应用程序在
中使用,所以我不得不走通用路线


关键是,设置非常相似,至少有
JupyterHub
仪表板之外工作,所以我真的很困惑我还缺少什么。非常感谢您的帮助。

您有没有偶然发现这家伙?没有,很遗憾:(我被解雇了)您有没有偶然发现这家伙?没有,很遗憾:(我被解雇了)