问题描述
我开始尝试Android Things,并试图以安全的方式将我的应用程序连接到Firebase实时数据库.
I am starting to experiment with Android Things and I am trying to connect my app to a Firebase Realtime Database in a secure way.
问题是Firebase身份验证不可用在Things中,因为它需要用户交互.
The problem is that Firebase Authentication is not available in Things because it requires user interaction.
我不想公开我的数据,那么有没有办法使用API密钥之类的方法来对Firebase数据库进行身份验证?
I don't want to leave my data public, so is there a way to authenticate to a Firebase Database using something like an API key?
推荐答案
在Android Things上,您仍然可以进行匿名身份验证和电子邮件/密码身份验证.使用电子邮件/密码,您可以在控制台中为Thing创建一个特殊帐户,然后使用这些凭据登录.缺点是您要么将密码烘焙到Thing中,要么找到一种方法来保留它们在某种程度上更安全.
On Android Things, you can still do anonymous auth and email/password auth. With email/password, you can create a special account for your Thing in the console, and use those credentials to log in. The downside is that you're either baking the password into the Thing, or finding a way to get a hold of them that's somehow more secure.
这篇关于如何使用Android Things对Firebase数据库进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!