添加密钥限制后无法登录Firebase [英] Can't login to Firebase after I added Key restriction

查看:46
本文介绍了添加密钥限制后无法登录Firebase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码登录Firebase:

I use this code to login to Firebase:

mAuth.signInWithEmailAndPassword(txtEmail.getText().toString().trim(),
    txtPassword.getText().toString().trim())
    .addOnSuccessListener(((ActivitySplash) mContext), authResult -> {
            /// do something
    })
    .addOnFailureListener(((ActivitySplash) mContext), e -> {
           /// do something else
    });

一切都是完美的,直到我添加了程序包名称和SHA-1签名证书指纹以仅由我的应用程序限制密钥使用.完成此操作后,我将无法登录.如果我取消限制,一切将再次正常运行.有建议吗?

All was perfect until I have added the package name and SHA-1 signing-certificate fingerprint to restrict key usage just by my application. After I did this I can't login anymore. If I remove restrictions all work perfectly again. Suggestions?

推荐答案

当我们在Firebase中注册android应用时,我们将提供程序包名称和SHA证书(可选),以防万一,需要更新Firebase中的相​​应项目并下载更新的google-service.json并将其放置在项目的根目录中

When we register the android app in Firebase, we will be providing the package name and SHA certificate(optional), In case if any of these two then you might need to update the corresponding project in firebase and download the updated google-service.json and place it in your root directory of the project

这篇关于添加密钥限制后无法登录Firebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆