Maybe i should give up on my project. There is no way to work with firebase rules write and read setted to true
Nothing?
I think they should disable the Firebase security rules section from docs. Seems that this problem is like 4 months old…
Not yet. We’re still working on it.
@GaryH If you don’t mind asking, what were you actually using? Firebase authentication only or Firebase Realtime database only or both?? I didnt understand that from the above messages.
If you are trying to secure your database, then you may look into Firebase documentation regarding defining rules to who can access your data.
Secure Your Data | Firebase Realtime Database
Learn to Secure Files | Firebase
We are using Firebase auth and firebase databasee
When we set up the proper rules in firebase (not read/write: true or read/write: false, but actual rules, so that users can only read and write their own data, for example) we get an auth error in our apps.
@Kodular team is aware of the issue.
Leave this block empty to ignore the error.
You need to upload a file named google-services.json to the assets folder. You can get this file from your Firebase Console.
Hassan, the json is there. There is a bug that doesn’t allow access to the database if you set up rules. The Kodular team is working on it.
Mine works just fine with rules set to auth users only.
Do you update the ID token after login?
Add a clock. I prefer 1sec
Then set your project bucket.
My rules are private to my DB structure.
I tested it with theses rules below and it works!
{
"rules": {
".read" : "auth.uid != null",
".write" : "auth.uid != null",
}
}
Try with a new project and let me know the result.
I access different buckets from the same database from different pages on my app. I also use the when data changed block. Do you know if this method might work in this case?
This is exactly what I do. It works fine. Follow my steps above and report the result.
Do I need to update the token on each screen?
but how do a new user write in database?
No, once the user signed-in and you updated the token in Screen1 for instant, no need to update in Screen2.
Follow my posts above.
In summary:
- Set the right rules according to your DB structure. Reference
- User sign-in.
- Authentication success.
- Update the token.
- Set your project bucket.
Don’t forget
Does that error block need to go on each screen I’m accessing FB from?
I use it only in Screen1, where the users sign-in. I leave it empty in order to not bother the users with (permission denied) error which appear before the sign-in Auth.
Huzzah! It Works! @storkgdev, @gopayarg, I got it to work with “auth.uid != null” following this method.