15

In Firebase 2 a user could create a custom token and specify a debug flag, this in turn would return a lot of debugging information about the permissions. In Firebase 3, it appears this has been removed.

Is there any way, maybe through the REST API to get this permission debugging data back on web (javascript)? Attempting to debug a permissions file with over 1k lines isn't exactly feasible through the simulator at times.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Ramzi C.
  • 1,691
  • 1
  • 14
  • 27

3 Answers3

6

I have to say that I'm evaluating Firebase for a project and really like so much about it but the debugging of security rules is so painful that I'm really getting ready to scrap use of it. I'm just putting together a few updates to process and all I get back is "FIREBASE WARNING: update at / failed: permission_denied "

And this is with using Bolt to make things a little more readable. And having painstakingly gone through the Simulator to test everything.

Dominic Tracey
  • 767
  • 6
  • 14
  • 1
    It's been some time and I've largely given up on verbose permission warnings. It was a terrible oversight to ever remove it. And from what I've seen they seem to have no intention of bringing it back. – Ramzi C. Nov 23 '16 at 21:53
0

I think you can still use the Rest API with custom tokens from the original JWT token generator on Firebase 3 projects - but you have to use the "deprecated" (but not yet removed) Database Secret.

I use this in testing the Bolt compiler, for example.

mckoss
  • 6,764
  • 6
  • 33
  • 31
0

If your using Firestore, you could call firebase.firestore.setLogLevel(Logger.Level.DEBUG). It helped me a lot in understanding my security rule issues.

Christian
  • 305
  • 1
  • 4
  • 13
  • 4
    Can you expand on this a little bit? Give an example? What defines Logger? – matth Jun 26 '17 at 05:29
  • Sorry for the confusion, but it seems to be available only for `firestore`, [details here](https://github.com/firebase/firebase-js-sdk/blob/6ef51fe61284c53c2fe4e3366519ab2e47475802/packages/firestore/index.ts). I've edit the answer to be more explicit. – Christian Feb 03 '20 at 15:59