Firebase permission denied even after authenticating

Hi, I have successfully configured my app to authenticate users by email. After users authenticate from the login screen, they go to the main screen. However, I am getting this error whenever I try to read data from firebase:
‘Firebase Error: Permission denied’ as a popup dialogue.
I had written my rules as “.read” = “auth.uid != null”
Because of the error, I changed it into “.read” = “true”.
Now the app is reading the data, but still, the same error dialogue pops up.
Anyway to solve this?

2 Likes

I think you have to visit this page,

https://docs.kodular.io/guides/component-examples/securing-app/#overview

I referred to this earlier… I can’t get any data with “.read” = “auth.uid != null” even after authenticating… and also permission denied error is coming up…

Firebase is too much of a headache… I spent many hours scratching my head to work around firebase.

It’s been almost 1 month I started to build this…and I am getting problems at every step.

Alright, I am switching to Airtable. Period.

3 Likes

Thats why i am using airtable spreadsheet, secure and easy

Please don’t hijack this topic.
Would be appreciated if you could remove non-Firebase posts as they aren’t helpful in finding a solution.
Thanks

4 Likes

You need to change your database rules… Write true in your firebase database rules instead of false.

Companion or APK?

I did everything… when I write my rules as “.read” = “auth.uid != null”, I am not getting any data even after authenticating, and also ‘Permission Denied’ error dialogue pops up.

When I write my rules as “.read” = “true”, the data is fetched, but still, the same error dialogue pops up.

1 Like

Well, you can’t authenticate while on companion(I think so), so I tested the apk.

1 Like

Are your authenticated users showing up in the “Authentication” tab of your Firebase console?

Yep! authentication is working fine. But after I switch to the screen with firebase database component, I get a popup dialogue saying “Permission Denied”. And as I said before, this error dialogue pops up when the rules are set to true or “.read” = “auth.uid != null”. However, I can read the data when rules are set to true. Not in case of “.read” = “auth.uid != null” though. Still the error dialogue pops up in each case.

1 Like

What happens if you try reading/writing the data from the screen where you authenticate your users?

No, I didn’t try that because it will be too messy if I use the same screen for login and reading data. I am using the main screen as my login now.
Earlier, I used to check whether the user is signed in on my main screen, and if not, switch to login screen. But this also brought up the error dialogue, just because the firebase database component was on main screen. I didn’t call any data from the firebase, but still the error showed up. that’s why I made my main screen my login screen, hoping that this error would go. But still…

I have the same problem. Have you successfully resolved your problem? if it has succeeded, can you explain the way you do? thanks.

1 Like

Any solution? I don’t want to leave my firebase open for anyone to access. Login is successful and the user is showing up in my authentication list, but when I switch to my home screen (or any other screens since I have a few that access firebase) after login I get the same error.

3 Likes

Hi, someone who has managed to solve this problem?

Hi! The @kodular team says they are working on it. Hopefully we’ll have a solution soon, we really need it.

5 Likes

Is there some news about this or any way to solve it?

I think it is very important, because not all users are opening the app in less than an hour

You can try using Firebase Auth extension.

I tried same result. But I didn’t tried those refresh variables because I kind of don’t understand which would be the difference. Have you tried them?