Firebase without Authentication

For my App I don’t want users to have to log-in. The users will only need to view data. No updating, submitting, or deleting data. Only I will need to manipulate the data.

Anyone have any tips on how to achieve this? When I’m connecting the data I’m receiving this error:

Error: JSON error response from server: {“error”:{“code”:403,“message”:“Missing or insufficient permissions.”,“status”:“PERMISSION_DENIED”}}.status: 403

Resource settings for Get collection (GET)

Resource URL: https://firestore.googleapis.com/v1
Relative path: /projects/rainfallcsv-290915/databases/(default)/documents/rainfall

This is my rule in firebase:
rules_version = ‘2’;
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}

It looks like you are using Firestore within Firebase. You are correct that this would be accomplished by using the Firestore rules.

Try a rule like this:
rules_version = ‘2’;
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow write: if request.auth != null; //need to be authenticated to write (or use “if false”)
allow read: if true;
}
}
}

1 Like

Thanks Geoff, it works!