简体   繁体   English

Firebase使用Google登录身份验证

[英]Firebase sign in auth with google

I have a sign in page using firebase and you basically use your google sign in option to log into the app. 我有一个使用firebase的登录页面,并且您基本上是使用Google登录选项登录该应用程序的。 the problem is when the app is run on my computer it works. 问题是当该应用程序在我的计算机上运行时可以运行。 but doesn't work anywhere else when other developers try to run my same code. 但是当其他开发人员尝试运行我的相同代码时,则无法在其他任何地方使用。 we figured out it may have something to do with the sha-1 key. 我们发现这可能与sha-1键有关。 when i remove that key and another developer add that key on the project from their machine, the app let them sign in perfectly. 当我删除该密钥并且另一位开发人员从他们的计算机上将该密钥添加到项目中时,该应用程序使他们可以完美登录。 we want to make it so that anyone can log in without any problem when we run the code in other system. 我们希望这样做,以便我们在其他系统中运行代码时任何人都可以登录而不会出现任何问题。

For each developer machine, 对于每台开发机,

SHA Key of debug keystore should be generated and added to firebase project settings page. 应生成调试密钥库的SHA密钥,并将其添加到Firebase项目设置页面。 It will allow for multiple SHA keys so no probs. 它将允许多个SHA键,因此没有问题。

Finally when you publish your app to google play store, do not forget to add SHA key of your release keystore. 最后,当您将应用程序发布到Google Play商店时,请不要忘记添加发布密钥库的SHA密钥。

You just have to create one key for the project and add it to firebase and it allows everyone to access it. 您只需要为该项目创建一个密钥并将其添加到firebase中,即可使每个人都可以访问它。 You don't have to add each one from every machine. 您不必从每台计算机添加每个。 It worked for me. 它为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM