[英]Unable to authenticate a user using firebase auth service from google chrome extension
I am developing a chrome extension which would require login before using that extension any further. 我正在开发一个chrome扩展程序,在进一步使用该扩展程序之前,需要先登录。 I am using Firebase Authentication service to authenticate user to my extension. 我正在使用Firebase身份验证服务对我的扩展程序进行身份验证。 But something is not working out here. 但是,这里没有解决问题。
A user will enter email and password that will use firebase to authorize. 用户将输入将使用Firebase进行授权的电子邮件和密码。 I am using it like this. 我正在这样使用它。
firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(error);
// ...
});
Everything is working fine but when I try to invoke sign in it return some error in background page. 一切正常,但是当我尝试调用登录时,它会在后台页面中返回一些错误。
code:"auth/internal-error"
message: "{"error":{"errors":
[{"domain":"usageLimits","reason":"keyExpired","message":"Bad
Request"}],"code":400,"message":"Bad Request"}}"
Also this : 另外这个:
www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=AIzaSyCI3pO1QSw_ciZy_Wd0CePyTlFwbUZV340 Failed to load resource: the server responded with a status of 400 ()
Here is my firebase config: 这是我的firebase配置:
var firebase_config = {
apiKey: "<api-key>",
authDomain: "<domain>",
databaseURL: "<db-url>",
projectId: "<project-id>",
storageBucket: "example.appspot.com",
messagingSenderId: "5111111111"
};
firebase.initializeApp(firebase_config);
I am invoking all the firebase related functions inside background.js page. 我正在background.js页面内调用所有与Firebase相关的功能。 Don't what is not working out here. 不要在这里行不通。 Please let me know if I am making anything wrong here. 如果我在这里做错了任何事情,请告诉我。
Fixed the issue. 解决了该问题。 There were some mistakes from my end in properly configuring firebase. 最终,在正确配置Firebase时出现了一些错误。 It's working now after some tweaks. 经过一些调整后,它现在可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.