February 28, 2022, 9:13am
I want to set my database use with the general security rules : " Authenticated-only mode"
For testing this, i built a simple realtime database :
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 >>
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 ?
February 28, 2022, 10:02am
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 :
Friends I’m trying to protect realtimeDB with authentication but I’m having difficulties. First of all as soon as the app starts a firebase permission error message is displayed and I can’t read or write anything to the DB.
I’m using Google account authentication and it’s working fine, I got the user ID, email and so on.
But it seems to me that firebase is not authenticating because when I release DB rules I can read and write normally and error messages will stop.
Does anyone know how to do …
And Hassan (great Thks
) gave a solution that works fine for me !!
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.
It seams that the firebase database token ID had to be refresh after successfull login !
have a nice day
March 30, 2022, 10:02am
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.