oauth-2.0 - Shopify:获取 OAuth 访问 token 的问题

标签 oauth-2.0 meteor shopify

我已经在 OAuth 的第 1 步中毫无问题地检索了授权码,但在我的一生中,我无法完成一篇文章来获取访问 token 。我总是得到同样的错误:
content: "{"error":"invalid_request","error_description":"Could not find Shopify API appli... (length: 103)"
这是我的代码的样子... Meteor.http.post 是一个标准的发布请求。我尝试了各种组合,但没有任何运气。我正在本地主机上开发:

var url = 'https://' + shopName + '/admin/oauth/access_token';    
var data = { client_id: apiKey, client_secret: secret, code: code };

Meteor.http.post(url, data,
    function(error, result) {
        debugger;
    });

Meteor.post 是标准的服务器端发布请求 documented here .我尝试过参数(如 Node Wrapper)、数组(如 PHP)和其他东西的组合。我不知道。

是不是因为我在本地主机上开发并且服务器调用现在需要 https?我的帖子数据结构错了吗?

任何其他想法我做错了什么?

最佳答案

我知道你说过你尝试过 params 但将 params 作为这样的数据放置是行不通的。尝试这个..

var url = 'https://' + shopName + '/admin/oauth/access_token';    
var data = { client_id: apiKey, client_secret: secret, code: code };

Meteor.http.post(url, {params:data},
    function(error, result) {
        debugger;
});

关于oauth-2.0 - Shopify:获取 OAuth 访问 token 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14367387/

相关文章:

Javascript 动态移动 IMG 元素

Angular 4 - 在每个请求上设置 withCredentials - cors cookie

shopify - 将表格免费试用转移到 Shopify 上的合作伙伴帐户

javascript - 需要 "add to cart"按钮价格以根据选中的复选框更新正确的金额

javascript - Angular Meteor 应用程序在本地主机中运行,但在部署到服务器时失败

javascript - 基于 Meteor 中嵌套文档的自定义 ID 的条件更新插入

javascript - 无法使用 react 表在 Meteor 中创建删除按钮

heroku - 在 Heroku 上使用 Google 的 TextToSpeech API

oauth-2.0 - 如何使用 Google 的 OAuth 2.0 强制单个帐户用户登录帐户?

python - 通过 Gmail API 发送 Excel 文件但附件已损坏