我使用的是无所不在的大商业宝石
在auth回调过程之后,来自大商业的回应。在params中,缺少通过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发布于 2015-07-20 06:05:26
Bigcommerce刚刚转移到基本的auth到omini auth,所以还有一些API的问题。我已经联系了他们,并得到回复说他们很快就会解决所有的问题。
发布于 2015-07-17 06:38:36
一切看起来都很好。我想你是期望在错误的地方得到预期的反应。
在回调操作中,您可以获得所需的令牌,如下所示:
auth = request.env['omniauth.auth'] # All required details are in this Auth Hash
token = auth[:credentials][:token]为了更好地理解,您可能想看看Auth散列模式。
https://stackoverflow.com/questions/31469125
复制相似问题