Ouath2 Google Meteor

时间:2015-05-05 18:55:38

标签: meteor oauth meteor-accounts service-accounts

我尝试使用Accounts-google包连接谷歌。

我已经安装了2个软件包。

meteor add service-configuration
meteor add accounts-google

这就是我的server/config.js文件的外观。

ServiceConfiguration.configurations.upsert(
  { service: "google" },
  {
    $set: {
      clientId: "xxxxxxxx",
      loginStyle: "popup",
      secret: "xxxxx"
    }
  }
);

我在谷歌控制台上的设置。

Javascript起源:http://localhost:3000/

重定向网址:http://localhost:3000/_oauth/google?close

但我总是得到同样的错误。

enter image description here

很明显错误会在重定向网址上进行中继,因此这个http://localhost:3000/_oauth/google?close有问题吗?

我已经按照Github issue #2717

处的Slava指出的步骤进行操作

1 个答案:

答案 0 :(得分:3)

在Google开发者控制台中检查api密钥的设置,确保已将http://localhost:3000/添加到授权来源,并http://localhost:3000/_oauth/googlehttp://localhost:3000/_oauth/google?close添加到您的授权重定向网址。