gpt4 book ai didi

github - 为什么 github API 使用 token 而不是 Bearer 作为他们的授权类型

转载 作者:行者123 更新时间:2023-12-01 15:03:25 25 4
gpt4 key购买 nike

为什么github API使用token而不是Bearer作为授权类型?

参见 github.js第61行

最佳答案

我查看了 Github OAuth 指南,找到了 response to successful authorization request采用以下形式:access_token=e72e16c7e42f292c6912e7710c838347ae178b4a&scope=user%2Cgist&token_type=bearer,其中 token_type 是bearer

但是在Use the access token to access the API ,请求方法是将其包含在 Authorization header 中:授权:token OAUTH-TOKEN

作为The OAuth 2.0 Authorization Framework说:

Each access token type definition specifies the additional attributes(if any) sent to the client together with the "access_token" responseparameter. It also defines the HTTP authentication method used toinclude the access token when making a protected resource request.

Bearer 是 standard Authentication Scheme .我还没有找到使用 token 作为方案的任何其他 OAuth 实现。

所以这很有趣,我希望一些 Github 的人可以对此发表他们的想法。

关于github - 为什么 github API 使用 token 而不是 Bearer 作为他们的授权类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24815410/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com