i need to store certain variables in the database and in the storage. but is important to have the certainty that this variables will be saved in the two databases and not only in one, furthermore this variables must be have the same values. but i see that storage and database not are in communication. how do I fix this?
Firebase Security Rules for Cloud Storage ties in to Firebase Authentication for user based security. When a user is authenticated with Firebase Authentication, the request. auth variable in Cloud Storage Security Rules becomes an object that contains the user's unique ID ( request.
1. Admin SDK bypasses security rules. As you explore security rules in depth, you will eventually discover that requests from the Firebase Admin SDK are not gated by rules. The Admin SDK is initialized with a service account, which gives the SDK full access to your data.
To access your rules from the Firebase console, select your project, then in the left-hand navigation panel, click Storage. Click Rules once you're in the correct database or storage bucket. To access your rules from the Firebase CLI, go to the rules file noted in your firebase. json file.
Firebase Realtime Database Security Rules determine who has read and write access to your database, how your data is structured, and what indexes exist. These rules live on the Firebase servers and are enforced automatically at all times. Every read and write request will only be completed if your rules allow it.
The short answer is that currently, security rules from one service can't access data from another service. See this thread for more info (similar general problem).
If the data you're hoping to share is user specific, you can mint custom tokens which contain this data, that can be shared across services (as both services get the same token).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With