2014-10-03 33 views
4

我是一个新手,流星,只是用账户,谷歌(见下文)遇到了一个问题。我所做的只是按照http://docs.meteor.com/#meteor_loginwithexternalservice上的说明操作。关于如何解决这个问题并让Google登录工作的任何想法?谢谢!流星JS账户,谷歌包不是为我工作

端子输出:

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 

当我注释掉(下)

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

我的业务配置码要求我先自举下拉GUI进入的clientId和秘密。之后没有任何反应。

后,我加入服务的配置,我碰到下面的错误在登录后: enter image description here

回答

11

事实证明,除了meteor add service-configuration,你必须完成至少都在谷歌的API网站的以下的:

  1. https://console.developers.google.com/project
  2. “创建项目”
  3. 等待项目预配置
  4. “API & AUTH” 侧边栏上的 “证书”
  5. “创建新客户端ID”
  6. 粘贴在 “授权JavaScript的起源” 和 “授权的重新导向URI”
  7. “创建客户端ID”
  8. 复制客户端密钥和客户端ID对侧边栏应用程式设定
  9. “API &身份验证”,“同意画面”
  10. 输入字段“产品名称”,并保存

步骤9 & 10似乎是从谷歌在过去几天了新的要求。有关该问题,请参阅this Github ticket

10

您需要手动meteor add service-configuration

你的代码的其余部分对我来说很好。

你还需要确保你在谷歌开发者控制台配置正确的事情。

在REDIRECT URIS部分添加http://localhost:3000/_oauth/google?close,以及为JavaScript源文本部分的http://localhost:3000/

这是为了在本地主机上进行测试,您需要在推送到产品时添加已部署的应用实际ROOT_URL(http://www.example.com/)。

我解决了类似的问题在这里:

Meteor.user is null after (apparently) successful login

+0

感谢你的帮助,这让我更进了一步。但是,现在我得到了一个不同的错误。我编辑了我的原始文章以包含图像。您是否熟悉导致该问题的原因? – FullStack 2014-10-03 06:19:50