Bigcommerce oauth 流程缺少具有商店哈希的上下文

Big commerce auth flow missing Context having store hash

我正在使用 omniauth-bigcommerce gem

经过身份验证回调过程后,响应来自大型商业。在参数上下文中缺少通过 post 请求

获取访问令牌所需的内容
{"code"=>"nf0cayio41l0ws4vtpfyl18hwbd3v13",
 "scope"=>"users_basic_information store_v2_products store_v2_information",
 "state"=>"b599054a60ecb7d7a8f0987bef3eb2c29b5631c40266b92c",
 "controller"=>"home",
 "action"=>"after_authantication_create",
 "provider"=>"bigcommerce"}

编辑:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :bigcommerce, "MY_KEY", "MY_SECRET",
           {
             scope: "users_basic_information store_v2_products store_v2_information",
             client_options: {
                               site: 'login.bigcommerce.com';
                             }
           }
end

一切看起来都很好。我认为您在错误的地方期待期望的响应。

在您的回调操作中,您可以获得所需的令牌,如下所示:

  auth = request.env['omniauth.auth'] # All required details are in this Auth Hash
  token = auth[:credentials][:token]

你可能想看看 Auth hash Schema 以便更好地理解。

Bigcommerce 刚刚将基本身份验证转移到 omini 身份验证,因此 API 仍然存在一些问题。我已经联系他们并得到回复说他们会尽快解决所有问题。