【问题标题】:OAuth1 Authentication in Fetch获取中的 OAuth1 身份验证
【发布时间】:2016-06-11 01:11:45
【问题描述】:

我正在尝试使用 OAuth 令牌连接我的 drupal。 我能够使用将 OAuth1 身份验证设置为标头的 PostMan 成功完成此操作。 在我的 javascript 应用程序中,我使用 Fetch 获取请求,问题是如何添加标题。 在 php 中可以使用 GuzzleHttp\Subscriber\Oauth\Oauth1;类 (Ref)

但是如何在我的 JS 应用程序中做到这一点?我可以使用什么库来生成与 OAuth 兼容的正确标头,使用 Consumer Secret 和 Client Key

示例 JS 代码

return fetch('http://d8.epicureans.in/node/1?_format=json', {'mode': 'no-cors',
method: 'get',
headers: {},
})

【问题讨论】:

    标签: javascript php drupal oauth


    【解决方案1】:

    我使用 oauth-1.0a 解决了它 检查实施 https://github.com/ddo/oauth-1.0a/issues/35

    【讨论】:

      猜你喜欢
      • 2022-01-20
      • 2020-06-05
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      • 2021-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多