Firebase身份验证错误代码:auth / app-not-authorized

时间:2017-08-17 10:15:05

标签: javascript authentication firebase firebase-authentication firebase-hosting

我使用了firebase身份验证使用电子邮件地址和密码登录用户。我还启用了电子邮件/密码&我使用了firebase托管。

显示

错误代码>> AUTH / APP-未授权的

按摩>>此应用由其托管的域标识,无权使用提供的API密钥使用Firebase身份验证。在Google API控制台中查看您的关键配置。

   firebase.auth().signInWithEmailAndPassword($('#username').val(),                  $('#password').val())
            .then(                     
            )
            .catch(function (error) {
                var errorCode = error.code;
                var errorMessage = error.message;            
        console.log(">>>"+errorCode+">>"+errorMessage);                 
            });

2 个答案:

答案 0 :(得分:2)

您必须在浏览器API密钥上添加密钥限制。您需要转到Google Cloud控制台并删除这些限制。

答案 1 :(得分:0)

https://console.cloud.google.com/apis/credentials/oauthclient/

Go to OAuth 2.0 client IDs > Web client (auto created by Google Service)

并添加完整的域名

添加www而不使用www

- www.yourdomanin.com

- yourdomanin.com

enter image description here

相关问题