如何在 cookie 中发送 oauth2 access_token? (香港 oauth2 插件)

How to send oauth2 access_token in cookies ? (kong oauth2 plugin)

我正在使用 Kong oauth2 插件来处理我的 dash plotly 应用程序的身份验证。 Dash plotly 不允许用户为请求设置自定义 header,因此很难向我的请求添加身份验证 header。

这些 header 非常适合普通网页 "Authorization": "Bearer snakjdnjsbcksnbnddnndnsms""authorization": "snakjdnjsbcksnbnddnndnsms"

但是,由于 Dash Plotly 的限制不允许设置 headers,我想尝试在 cookie 中发送授权令牌。 我尝试通过我的烧瓶应用程序发送一个带有 "authorization" 键和相应值的 cookie,但是我仍然收到未经授权的响应。

这种方法可行吗?我看到它在 nodejs 的 loopback.token 中使用签名 cookie 工作。如果是这样,我怎样才能做到这一点?感谢这方面的任何帮助。

我不认为,这甚至是可行的。根据 OAuth 2.0 RFC,访问令牌应作为持有者传递 header.

Typically, it involves using the HTTP "Authorization" request header field [RFC2617] with an authentication scheme defined by the specification of the access token type used, such as [RFC6750].

Link to RFC 6749