Meteor JS 帐户-google 包对我不起作用 [英] Meteor JS accounts-google package not working for me

查看:18
本文介绍了Meteor JS 帐户-google 包对我不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Meteor 新手,刚刚在使用帐户谷歌时遇到了问题(见下文).我所做的只是按照

  • 创建项目"
  • 等待项目配置
  • 侧边栏上的API & auth",凭据"
  • 创建新的客户 ID"
  • 粘贴Authorized JavaScript origin"和Authorized Redirect URI"
  • 创建客户端 ID"
  • 将客户端密钥和客户端 ID 复制到您的应用配置中
  • 侧边栏同意屏幕"上的API & auth"
  • 输入字段产品名称"并保存
  • 步骤 9 &10 似乎是过去几天 Google 的新要求.有关该问题,请参阅此 Github 票.

    I am a Meteor newbie and just ran into a problem using accounts-google (see below). All I did was follow the instructions on http://docs.meteor.com/#meteor_loginwithexternalservice. Any ideas on how to solve this issue and get Google login working? Thanks!

    Terminal output:

    W20141003-09:42:57.115(7)? (STDERR) 
    W20141003-09:42:57.116(7)? (STDERR) /Users/aw/.meteor/packages/meteor-tool/.1.0.33.alt9dq++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
    W20141003-09:42:57.116(7)? (STDERR)                         throw(ex);
    W20141003-09:42:57.117(7)? (STDERR)                               ^
    W20141003-09:42:57.118(7)? (STDERR) ReferenceError: ServiceConfiguration is not defined
    W20141003-09:42:57.119(7)? (STDERR)     at app/server/accounts.js:26:1
    W20141003-09:42:57.120(7)? (STDERR)     at app/server/accounts.js:35:3
    W20141003-09:42:57.120(7)? (STDERR)     at /Users/aw/TS/.meteor/local/build/programs/server/boot.js:168:10
    W20141003-09:42:57.120(7)? (STDERR)     at Array.forEach (native)
    W20141003-09:42:57.121(7)? (STDERR)     at Function._.each._.forEach (/Users/aw/.meteor/packages/meteor-tool/.1.0.33.alt9dq++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
    W20141003-09:42:57.121(7)? (STDERR)     at /Users/aw/TS/.meteor/local/build/programs/server/boot.js:82:5
    => Exited with code: 8
    

    When I comment out my service configuration code (below)

    // first, remove configuration entry in case service is already configured
    ServiceConfiguration.configurations.remove({
      service: "google"
    });
    ServiceConfiguration.configurations.insert({
      service: "google",
      clientId: "xxxxxxxx",
      secret: "xxxxxxxxx"
    });
    

    It asks me to enter the clientId and secret from the bootstrap dropdown gui. Then nothing happens after that.

    After I add service-configuration, I get the following error after logging in:

    解决方案

    It turns out that in addition to meteor add service-configuration, you have to complete a minimum of all of the following in Google's API website:

    1. https://console.developers.google.com/project
    2. "Create Project"
    3. Wait for the project to be provisioned
    4. "API & auth" on the sidebar, "Credentials"
    5. "Create new Client ID"
    6. Paste in "Authorized JavaScript origin" and "Authorized Redirect URI"
    7. "Create Client ID"
    8. Copy the Client Secret and Client ID to your app configuration
    9. "API & auth" on the sidebar "Consent screen"
    10. Enter the field "Product Name" and save

    Steps 9 & 10 appear to be new requirements from Google in the past few days. See this Github ticket regarding the issue.

    这篇关于Meteor JS 帐户-google 包对我不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆