Firebase实时数据库规则以类似于JSON的格式表示,因此您应该立即为自己创建一些规则!If one integrates this config in JS, won't it be a security concern as any one can open the JS file, get access to this details and access my firebase DB?var config = { apiKey: "xxxx", authDomain: "xxx.firebaseapp.com", databaseURL: "https://xxx.firebaseio.com", storageBucket: "xxx.appspot.com", messagingSenderId: "0000"};How does one make sure it's secure? 解决方案 That's just so the client can identify your app. Even the apiKey is more like a reference and less like a secret password so don't worry. You can use this to instantiate many apps inside a single file. (see https://firebase.google.com/docs/web/setup)// Intialize the "[DEFAULT]" Appvar mainApp = firebase.intializeApp({ ... });// Intialize a "Secondary" Appvar secondaryApp = firebase.initializeApp({ ... }, "Secondary");...mainApp.database().ref("path/to/data").set(value);secondaryApp.database().ref("path/to/data").set(anotherValue);Now, the heart of Firebase security are the Firebase Realtime Database Rules. Learn them here:https://firebase.google.com/docs/database/security/The Firebase Realtime Database Rules are expressed in a JSON-like format, so you should be creating some for yourself in no time! 这篇关于在了解Firebase配置安全性方面需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 16:19
查看更多