【发布时间】:2020-06-27 22:14:52
【问题描述】:
在每个端点被命中之前,令牌被授权。我创建了与下面相同的应用程序
os.environ[TOKENINFO_FUNC] = some_function
add.api(openapi.yaml)
app.add_error_handler(OAuthResponseProblem, render_unauthorized)
def render_unauthorized:
return customized response
def some_function:
raise OAuthResponseProblem
这是挂钩异常的正确方法吗?我收到上述代码的错误。这里 render_unauthorized 没有被调用。我想验证令牌并发送端点用户自定义响应。提前致谢。
【问题讨论】:
标签: python flask oauth-2.0 authorization connexion