2012-08-01 101 views
2

我試圖在本地機器上開發。我給自己定的facebook網站網址Facebook無效重定向URI

http://localhost:8000 

我的登入碼:

function tryFBLogin() { 
    FB.login(function(response) { 
    if (response.authResponse) { 
      console.log("User is connected to the application."); 
      var accessToken = response.authResponse.accessToken; 
      return http.HttpResponseRedirect(reverse('http://localhost:8000/page/')) 
     } else { 
      console.log("Something messed up in facebook login"); 
     } 
    }); 
} 

當我點擊登錄屁股上我收到此錯誤信息:

API Error Code: 191 
API Error Description: The specified URL is not owned by the application 
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration. 

回答

1

重定向參數必須匹配該應用的域。

將應用程序域設置爲空白,並將站點url設置爲要顯示的鏈接的根目錄。

App Domain: 
Site URL: http://localhost:8000 
+0

我想這一點,仍然得到代碼 - 通過重定向參數匹配域名相同的錯誤,你是在暗示我設置應用領域的空白,然後HttpResponseRedirect的網址是一樣的東西(逆轉(「/頁」) )?感謝幫助- – deakolt 2012-08-01 18:04:18