【问题标题】:How to make OAuth request with access token linkedin如何使用访问令牌linkedin发出OAuth请求
【发布时间】:2017-04-22 15:43:35
【问题描述】:

如果我有访问令牌,如何发出经过身份验证的请求?

我关注这个帖子: https://developer.linkedin.com/documents/authentication

并像这样传递访问令牌:

https://api.linkedin.com/v1/people/~?oauth2_access_token=一些令牌

我总是收到错误:

  <error>
     <status>401</status>
     <timestamp>1412404356540</timestamp>
     <request-id>01GPXMMPI4</request-id><error-code>0</error-code>
     <message>Invalid access token.</message>
  </error>

有人可以给我一些建议吗?我是 OAuth 的新手。

【问题讨论】:

    标签: oauth


    【解决方案1】:

    不应在查询字符串中发送访问令牌。它应该包含在authorization 字段的标题中。

    GET /v1/people/~ 
    ...
    Authorization: Bearer <access_token>
    

    【讨论】:

      猜你喜欢
      • 2013-07-24
      • 2011-08-13
      • 2019-02-19
      • 2011-09-19
      • 1970-01-01
      • 2012-03-23
      • 2018-08-22
      • 1970-01-01
      • 2012-03-27
      相关资源
      最近更新 更多