2

我尝试将 Okta 与flask-oidc集成到我的 Flask 应用程序中。示例应用程序适用于我的. client_secrets.json,但是当我将它集成到我的(更大)应用程序中时,我收到以下错误:

Traceback (most recent call last):
  File "/home/math/.local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/math/.local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/math/.local/lib/python3.6/site-packages/flask_oidc/__init__.py", line 486, in decorated
    return self.redirect_to_auth_server(request.url)
  File "/home/math/.local/lib/python3.6/site-packages/flask_oidc/__init__.py", line 550, in redirect_to_auth_server
    state[statefield] = self.extra_data_serializer.dumps(
AttributeError: 'OpenIDConnect' object has no attribute 'extra_data_serializer'

有趣的是,当我尝试访问受保护的视图时,我只会收到此错误@oidc.require_login。当我第一次登录然后访问受保护的视图时,它工作正常。我会期待重定向(flask-oidc 代码),就像它发生在非蓝图视图中一样。

如何使蓝图直接与 flask-oidc 一起使用?

4

0 回答 0