How To Write Security Rules Of Firebase-Realtimedatabase So Unauth User Can Read And Write Only At My Specific Nodes
I want to know how we can write firebase realtime database security rules in the way like unauthenticated user can read and write on a specific nodes only
Right now my security rules are like this
"rules": {
".read": "auth != null",
".write": "auth != null"
}
my database structure is like this
request
|-user_id
|-email:"value"
i want that the user can write from my Android app on this node even though he is not logged in using firebase auth
I am developing android app.
"rules": {
".read": "auth != null",
".write": "auth != null"
}
Answer
I want to know how we can write firebase realtime database security rules in the way like unauthenticated user can read and write on a specific nodes only
To allow unauthenticated users to read/write data on a specific ("request") section in your database, you should use the following rules:
{
"rules": {
"request": {
".read": true,
".write": true
}
}
}
For more information, please check the official documentation regarding authorization on a specific section in Firebase realtime database.
Related Questions
- → should I choose reactjs+f7 or f7+vue.js?
- → Phonegap Android write to sd card
- → Local reference jquery script in nanohttpd (Android)
- → Click to navigate on mobile devices
- → How to allow api access to android or ios app only(laravel)?
- → Access the Camera and CameraRoll on Android using React Native?
- → React native change listening port
- → What is the default unit of style in React Native?
- → Google play market autocomplete icon
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → Using Laravel with Genymotion
- → react native using like web-based ajax function
- → react native pdf View