1

我正在尝试通过以下方式使用 Firebase Facebook 登录:

将此添加到我的 HTML 中(以进行测试):

<div
  class="fb-like"
  data-share="true"
  data-width="450"
  data-show-faces="true">
</div>

和firebase脚本:

<script src="https://cdn.firebase.com/js/client/2.2.5/firebase.js"></script>

这在我的模块中:

var app = angular.module('myApp' ['firebase']);

然后在我的控制器内部:

controller('yokoAppCtrl', function($scope, $firebaseObject, $firebaseAuth, wordsFactory){
  var ref = new Firebase("https://resplendent-fire-4284.firebaseio.com/data");

  // download the data into a local object
  var syncObject = $firebaseObject(ref);
  // synchronize the object with a three-way data binding
  // click on `index.html` above to see it used in the DOM!
  syncObject.$bindTo($scope, "data");


  // create an instance of the authentication service
  var auth = $firebaseAuth(ref);

  // login with Facebook
  auth.$authWithOAuthPopup("facebook").then(function(authData) {
    console.log("Logged in as:", authData.uid);
  }).catch(function(error) {
    console.log("Authentication failed:", error);
  });
})

当我重新加载页面时,localhost:8000我从 Facebook 收到以下消息:

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.

我遵循了 Firebase 文档和这个 stackoverflow url:Facebook 应用程序:Firebase 简单登录 URL 错误,但我仍然迷路了。

在我的应用程序拥有的站点 URL 下http://localhost:8000/,我也尝试在域名下包含,localhost:8000但 Facebook 删除它说"No Top-Level Domains allowed"。这都在“基本”设置下。在“高级”下,我有以下内容Valid OAuth redirect URIs

https://auth.firebase.com/v2/<myFirebase>/auth/facebook/callback http://localhost:8080/ https://auth.firebase.com/auth/facebook/callback

我已经在 Firebase 中启用了 Facebook 连接。我错过了什么?

4

0 回答 0