How can we restrict firestore reads so that only the application's users are able to read from the database.
I am thinking of creating a user from the firebase console and hardcoding the user's credentials (email and password) and login to the app and subsequently, set this rule on the firebase console:
allow write: if request.auth.uid == "XXXXXXXXXXXXXXXXXXXX";
However, i don't want to hardcode the credentials inside the app due to security reasons.
Another workaround i know is to use firebase anonymous login and use this rule to restrict reads to unauthenticated users:
allow write: if request.auth != null;
What would be the best approach to this problem?