Setting security rules Firebase Database Access

Hi all,
I want to set my database use with the general security rules : " Authenticated-only mode"

For testing this, i built a simple realtime database :
image
I set the rules with read/write “auth.uid != null” & set The Sign-in Method in Firebase console
From Kodular side, i use Firebase Authentication & Firebase Database : my app is >>
image
And the blocks are :


When i run my app, i got the following results :

  • Exporting APK to device => OK
  • Login with Authentication => Ok & receive UID
  • Access Data (when click button "Get Data with TAG “Maison’ for example”) => FirebaseError , permission denied
    (for information, if i set the rules to read/write ‘true, true’, after click ‘Get Data’ i got the normal reponse ‘popilus’)
    Can somebody help me & tell me where i’m wrong ?
    Many Thks
    Loïc

Hi,
For those who are interrested to secure the access of their realtime database,
I’ve found another user that have mentionned the same problem two year ago :

And Hassan (great Thks :grinning:) gave a solution that works fine for me !!

It seams that the firebase database token ID had to be refresh after successfull login !
have a nice day
Loïc

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.