为什么github API使用token而不是Bearer作为授权类型?
请参阅github.js第61行
发布于 2014-07-18 10:28:33
我查看了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中:Authorization: token OAUTH-TOKEN
正如The OAuth 2.0 Authorization Framework所说:
每个访问令牌类型定义都指定了与"access_token“响应参数一起发送到客户端的附加属性(如果有)。它还定义了身份验证方法,用于在发出受保护的资源请求时包含访问令牌。
而持有者就是standard Authentication Scheme。我还没有发现任何其他使用token作为方案的OAuth实现。
所以这很有趣,我希望一些Github的人能给出他们的想法。
https://stackoverflow.com/questions/24815410
复制相似问题