【发布时间】:2018-03-03 09:52:20
【问题描述】:
目前正在尝试使身份验证安装正常工作,而当我阅读 BigCommerce 文档时,除了状态响应 200 之外的任何其他内容都被视为失败。
调试器日志:
node-bigcommerce:request Starting Request, with options. { path: '/oauth2/token',
hostname: 'login.bigcommerce.com',
method: 'POST',
port: 443,
headers:
{ 'User-Agent': 'node-bigcommerce/3.0.0',
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': 394 } } +0ms
node-bigcommerce:request Sending Data: {"client_id":"123456789abcdefghikl","client_secret":"123456789abcdefghikl","redirect_uri":"https://xxxxx.xxxxx.com:8080/auth","grant_type":"authorization_code","code":"<code from query>","scope":"store_v2_customers_login store_v2_customers_read_only store_v2_default store_v2_orders_read_only store_v2_transactions_read_only","context":"stores/<our_store>"} +5ms
node-bigcommerce:request Status Returned: 302 +234ms
node-bigcommerce:request Headers Returned: {"content-type":"text/html; charset=utf-8","transfer-encoding":"chunked","connection":"close","status":"302 Found","cache-control":"no-cache, no-store","strict-transport-security":"max-age=31536000, max-age=31536000; includeSubdomains","pragma":"no-cache","x-xss-protection":"1; mode=block","x-request-id":"123456789abcdefghikl","location":"https://login.bigcommerce.com/login","p3p":"CP=\"ALL DSP COR CURa ADMa DEVa OUR IND COM NAV\"","x-content-type-options":"nosniff","date":"Fri, 02 Mar 2018 23:53:16 GMT","set-cookie":["_bc_login_session=123456789abcdefghikl; path=/; expires=Sat, 03 Mar 2018 00:08:16 -0000; secure; HttpOnly"]} +1ms
node-bigcommerce:request Request complete +2ms
node-bigcommerce:request RESOLVED BODY: <html><body>You are being <a href="https://login.bigcommerce.com/login">redirected</a>.</body></html> +0ms
当前使用节点 v9.7.0
使用 BigCommerce 文档中列出的“node-bigcommerce”。
我曾想过 BigCommerce 不喜欢在回调 url 中使用端口号,比如我的端口 8080。但如果是这种情况,当我尝试使用端口 80 或 443 时节点会出错。
当我在我的沙盒商店中安装草稿应用程序时,进度指示器覆盖将消失,BC 将呈现我的 AUTH 回调 url 发送的 HTML。但是,当您刷新页面时,该应用将从导航中消失,我确定这是上述问题的结果。
关于问题可能是什么的任何想法?
【问题讨论】:
标签: node.js bigcommerce