Straight-forward: I'm using REST API calls and I want the rules to accept the calls only if they contain the web key of my database.
My rules are:
match /{document=**} {
allow read, write: if request.key == "my_Web_API_key";
}
But when I call
GET https://firestore.googleapis.com/v1/projects/my-project/databases/(default)/documents/users?key=my_Web_API_key
it returns me (403) Forbidden. I already tried things like
match /{document=**} {
allow read, write: if request.auth.uid != null;
}
but it gave me the same result.
How can I write the rules to only accept REST API calls that contain the web API key?