Firebase Authentication issue

Not yet. We’re still working on it.

@GaryH If you don’t mind asking, what were you actually using? Firebase authentication only or Firebase Realtime database only or both?? I didnt understand that from the above messages.

If you are trying to secure your database, then you may look into Firebase documentation regarding defining rules to who can access your data.
Secure Your Data  |  Firebase Realtime Database
Learn to Secure Files  |  Firebase

We are using Firebase auth and firebase databasee

When we set up the proper rules in firebase (not read/write: true or read/write: false, but actual rules, so that users can only read and write their own data, for example) we get an auth error in our apps.

@Kodular team is aware of the issue.

1 Like

Capture
Leave this block empty to ignore the error.

You need to upload a file named google-services.json to the assets folder. You can get this file from your Firebase Console.

Hassan, the json is there. There is a bug that doesn’t allow access to the database if you set up rules. The Kodular team is working on it.

Mine works just fine with rules set to auth users only.

Do you update the ID token after login?
1

Add a clock. I prefer 1sec
2

Then set your project bucket.
3

2 Likes

@Hassan_Alzaki What are your firebase rules? Can you show us a screenshot of your rules tree?

My rules are private to my DB structure.

I tested it with theses rules below and it works!

{
  "rules": {
    ".read" : "auth.uid != null",
    ".write" : "auth.uid != null",
  }
}

Try with a new project and let me know the result.

1 Like

I access different buckets from the same database from different pages on my app. I also use the when data changed block. Do you know if this method might work in this case?

This is exactly what I do. It works fine. Follow my steps above and report the result.

Do I need to update the token on each screen?

but how do a new user write in database?

No, once the user signed-in and you updated the token in Screen1 for instant, no need to update in Screen2.

Follow my posts above.

In summary:

  1. Set the right rules according to your DB structure. Reference
  2. User sign-in.
  3. Authentication success.
  4. Update the token.
  5. Set your project bucket.

Don’t forget

Does that error block need to go on each screen I’m accessing FB from?

I use it only in Screen1, where the users sign-in. I leave it empty in order to not bother the users with (permission denied) error which appear before the sign-in Auth.

1 Like

Huzzah! It Works! @storkgdev, @gopayarg, I got it to work with “auth.uid != null” following this method.

2 Likes

Glad to hear it works :heart_eyes:

Great!! I will give it a go!

Nice! Thank you guys!