简体   繁体   English

无法使用Google Chrome扩展程序中的Firebase身份验证服务对用户进行身份验证

[英]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.

相关问题 使用 Firebase Auth 通过小部件对用户进行身份验证 - Authenticate a user from via a widget using Firebase Auth 使用OAuth 2.0和客户端ID从Google Chrome扩展程序获取辅助ID的验证令牌 - Getting the Auth Token for the secondary Id from Google chrome extension using OAuth 2.0 & Client ID 如何使用外部身份验证服务对用户进行身份验证? - How to authenticate user with external auth service? Chrome 扩展程序通过您的网站对用户进行身份验证 - Chrome extension authenticate user via your website 保持身份验证状态Firebase + Chrome扩展 - Persist auth state Firebase + Chrome Extension 如果用户存在,则仅使用 Google 身份验证提供程序进行身份验证 - Only authenticate with Google Auth Provider if user exists Firebase 使用next auth时不认证 - Firebase does not authenticate when using next auth chrome扩展程序无法使用内容脚本和其他方式从Google加载外部JavaScript - chrome extension unable to load external javascript from google using content scripts and other ways 带有Google Chrome扩展名的Auth0无密码 - Auth0 passwordless with google chrome extension 无法确定在Chrome扩展程序中使用Javascript进行Google网上论坛搜索的结果 - Unable to determine the results of a Google Groups search using Javascript in a Chrome extension
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM