2014-10-03 31 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