6

我剛剛遵循這裏的優秀指南:https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0如何啓用Facebook登錄使用Javascript SDK的網站。測試Facebook的JavaScript從本地主機域登錄

我已經嘗試過了 - 當我點擊按鈕,我漂亮的日誌我的錯誤:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. 

我注意到這個錯誤的網址:

https://www.facebook.com/v2.0/dialog/oauth?scope=public_profile%2Cemail&response_type=none&redirect_uri=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Freturn%2Farbiter%3Frelation%3Dopener%26close%3Dtrue%23origin%3Dhttp%253A%252F%252Flocalhost%253A56378%252Ff1c45491ec&seen_revocable_perms_nux=false&ref=LoginButton&auth_type=&default_audience&state=fdcac98d4&app_id=251165285007053&client_id=251165285007053&display=popup 

所以我去我Facebook的應用程序,並添加我的無IP主機名和'本地主機' - 它不像本地主機,所以我刪除它。

但是,我仍然收到消息,因爲請求仍然從域localhost發送。

有沒有一種方法可以測試本地運行?我沒有要在開發過程中部署的域。

+0

答案在這裏找到: http://stackoverflow.com/questions/16294630/what-am-i-doing-wrong-in-localhost-facebook-app-development – RenegadeAndy

+0

你找到答案了嗎??? – MixedVeg

+0

是的,上面的鏈接。 – RenegadeAndy

回答

1

在您的應用程序的配置,應該如果你使用一個特定的本地主機端口您網站的網址設置爲http://localhost/

,必須包含(例如http://localhost:64321/