user10648409
user10648409

Reputation: 31

Firestore service rules for service account

I need to give write permissions for a particular collection to service accounts only. How to write security rules for that? Is there any field in request to identify service account?

Upvotes: 3

Views: 3573

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317392

Service accounts always have full access to all data in Firestore, regardless of any security rules defined for that data. If you want data to be read only by service accounts, simply reject all access in security rules so that mobile clients will never be able to access it, while service accounts will still always be able to access it.

allow read, write: if false;

Upvotes: 3

Related Questions