昨天,我发现了Firebase并开始使用它。我部署了Firebase提供的聊天应用程序的编辑版本(我刚刚更改了CSS),在添加Twitter日志选项之前,一切都进行得很顺利。虽然我跟踪了这些指示,并且激活了Twitter应用程序管理面板的“登录”,但我无法用Twitter验证我的应用程序。
这是我在聊天应用程序中用来登录的代码(其他任何内容都与我的代码中的Twitter登录有关):
// instatiate the FirebaseSimpleLogin and monitor the user's auth state
var chatRef = new Firebase('https://ranchat.firebaseIO.com');
var auth = new FirebaseSimpleLogin(chatRef, function(error, user) {
if (error) {
// an error occurred while attempting login
alert(error);
} else if (user) {
// user authenticated with Firebase
alert('Welcome' + user.username);
} else {
// user is logged out
}
});
// attempt to log the user in with your preferred authentication provider
$('#twlog').click(function(){
auth.login('twitter', {
RememberMe: true
});
});这些是我使用的Firebase规则
{
"rules": {
".read": true,
"$comment": {
".write": "!data.exists() && newData.child('twitter_id').val() == auth.id"
}
}
}这就是在我的应用程序中按下Twitter日志按钮后发生的事情
错误: FirebaseSimpleLogin:发生了未知错误
亲爱的我不知道为什么会这样。你能帮个忙吗?
发布于 2014-03-07 16:58:25
我找到了答案多亏了@RobDiMarco。
此错误是由于将Twitter和API秘密复制到我的Firebase Forge而产生的。我只需要复制这些,然后粘贴它这里。
发布于 2014-05-16 12:49:32
在Firebase简单登录文档中,术语非常混乱。防火基地需要三件事:
https://stackoverflow.com/questions/22104121
复制相似问题