Fire base validation details

Is there a way to get the real reason for the failure to save data in Firebase? Right now, it looks like any data validation or security issue results in a "PERMISSION_DENIED" error.

It's not particularly helpful. Does this mean the user is invalid? Does this mean that the user doesn't have permission to write somewhere? Does this mean that the "accountName" property must be longer than 2 characters and shorter than 500?

Permission denied means the user does not have permission.

Surely there is a way to find out about a VALIDATION failure?

+3


source to share


1 answer


Typically, you debug Firebase security rules in your Dashboard account under the simulator tab. Start by logging in with the same user rights that you do on the client. You only need to include those to which security rules apply, such as id or uid. Generally something like this:

simulator auth view

Then you can inject the payload you are trying to write on the client and see what rules are not being followed:



simulator write data

You can achieve this behavior on the client by creating a custom authentication token and adding it debug: true

to the configuration settings. But this is a little more involved .

+1


source







All Articles