2015-08-08 51 views
1

這是所有本地開發環境(在OS X),我有:流星手機應用爲Google OAuth提供redirect_uri_mismatch,如何修復帳戶的URL?

  1. 與虛擬主機
  2. 應用程序被正確送達myapp.dev(Nginx的地方通過代理爲localhost:3000 )
  3. 谷歌應用程序創建
  4. ServiceConfiguration.configurations合理設置服務的clientId,loginStyle和祕密

但在谷歌按鈕點擊時在我簽得到:

  1. That’s an error.

Error: redirect_uri_mismatch

Application: MyApp

You can email the developer of this application at: [email protected]

The redirect URI in the request: http://localhost:3000/_oauth/google did not match a registered redirect URI.

這在技術上是正確的,因爲,因爲谷歌不接受將特定的IP地址回調(僅localhost或某一領域的),我需要設置爲回調http://myapp.dev/_oauth/google,所以我可以用它來自移動設備。

的問題似乎涉及到賬號試圖重定向本地主機:中myapp.dev

3000,而不是我不知道設置如何帳戶使用此域名,或者也許是一個全球性的方式來告訴大家,流星應用程序,它應該使用myapp.dev域名

解決方案將是Meteor移動應用程序的任何開發環境設置的解決方案。由於

回答

2

google.js使用absoluteUrl()創建回調URL在客戶端的啓動使設置這應該給你你想要的回調:

Meteor.startup(function() { 
    // Client startup method. 
    Meteor.absoluteUrl.defaultOptions.rootUrl = 'http://myapp.dev/'; 
}); 
+0

非常感謝這對我的作品。但似乎無法讓它與Ngrok合作。 [鏈接](http://stackoverflow.com/questions/39860152/how-do-use-ngrok-in-conjunction-with-google-oauth?noredirect=1#)。任何想法都非常讚賞與賞金! – SirBT

+0

@SirBT看看,也許我的回答有幫助。祝你好運! –

相關問題