Android 如何确保Firebase中的数据安全?
假设我正在使用Firebase构建聊天室应用程序。在客户端代码中,我直接写入生产数据库(即聊天内容等) 如何确保客户端不能直接访问我的数据库?如果有人反编译我的apk,并更改我访问的表名,那么他们将能够写入我的任何数据库Android 如何确保Firebase中的数据安全?,android,firebase,firebase-realtime-database,Android,Firebase,Firebase Realtime Database,假设我正在使用Firebase构建聊天室应用程序。在客户端代码中,我直接写入生产数据库(即聊天内容等) 如何确保客户端不能直接访问我的数据库?如果有人反编译我的apk,并更改我访问的表名,那么他们将能够写入我的任何数据库 我需要澄清Firebase是如何安全的,而不需要在客户端和服务器之间提供中间层的安全性(不允许客户端直接访问数据库) 您必须为Firebase中的路径设置许可规则,即 { "rules": { "users": { // users is readab
我需要澄清Firebase是如何安全的,而不需要在客户端和服务器之间提供中间层的安全性(不允许客户端直接访问数据库) 您必须为Firebase中的路径设置许可规则,即
{
"rules": {
"users": {
// users is readable by anyone
".read": true,
// users is writable by anyone
".write": true
}
}
"important_table": {
// important_table is readable by anyone
".read": true,
// important_table is NOT writable by anyone
".write": false
}
}
}
更多: