Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Database Rules: Checking for service account credentials

if I have a service account set up and am initializing the app in a firebase function with the service account credentials to do some database maintenance work, how can I restrict the rules in the database so that only the service account is able to access that path in the database, how can I go about it?

The only available options in the auth object appear to be token, uid, and provider.

The only fields available in the service account json file are: { "type": "service_account", "project_id": "private_key_id": "private_key": "client_email": "client_id": "auth_uri": "token_uri" "auth_provider_x509_cert_url" "client_x509_cert_url" }

like image 854
Johnny Li Avatar asked Mar 22 '26 16:03

Johnny Li


1 Answers

Service accounts always bypass all security rules. It's not possible to write any security rules that limit the permissions of a backend SDK initialized with a service account.

like image 160
Doug Stevenson Avatar answered Mar 25 '26 11:03

Doug Stevenson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!