Firebase permission denied to read/write

I have set my app to have authentication/database.
The authentication works,i have uploaded the google-services.json
the only problem I have:
I would like my database to have secure rules like :
{
“rules”: {
“.read”: “auth!=null”,
“.write”: “auth!=null”
}
}

but it doesn’t work,it says permission denied every time.If i set the rules to true it works,what am I doing wrong?

Change the rules in your database like this :

{
/* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */
“rules”: {
“.read”: true,
“.write”: true
}
}

if he change thge rules to this, the database is open for every one, he wanted that the database is secure. He want to use the auth component to make the database secure, so that only people which are auth can read and write in the database.

5 Likes

Is there a solution to this problem? I’ve been scouring the community trying to solve this.