【发布时间】:2015-01-26 14:50:36
【问题描述】:
我正在尝试使用 Firebase 身份验证提供程序 https://www.firebase.com/docs/web/guide/user-auth.html#section-providers 连接社交媒体身份验证,但我得到的只是 Facebook 和 Twitter 的空白屏幕。
我已经在本地进行了测试,甚至使网站上线,但只是一个空白屏幕。
这是我的 Facebook 验证码
authRef.authWithOAuthPopup('facebook', function(error, authData) {
console.log(authData);
}, {
remember: 'sessionOnly',
scope: 'email,public_profile'
});
这是我的 Twitter sn-p:
authRef.authWithOAuthPopup('twitter', function(error, authData) {
if (authData) {
// the access token will allow us to make Open Graph API calls
console.log(authData);
}
console.log(error);
});
请注意,我使用的是最新版本的 Firebase v2.0.5,SimpleLogin 是核心的一部分,而不是单独的库。
New Firebase instance:
var authRef = new Firebase(myfirebase);
点击事件:
$('social-auth').on('click',function(e) {
e.preventDefault();
var socialSite = this.getAttribute('data-social-site');
If(socialSite === 'facebook') {
// this where the Facebook OAuthPopUp is called.
facebook();
}
}
【问题讨论】:
-
你在哪个平台上测试,遇到错误?
-
在 Mac OS x 上并在浏览器 safari、firefox 和 chrome 上测试。
-
尝试仔细检查您的配置(Firebase 仪表板中的 OAuth 凭据和 OAuth 提供者仪表板中的回调 URL),如果没有,请尝试联系 support@firebase.com做这个伎俩。
标签: firebase firebasesimplelogin