'How to protect some data in firebase firestore?
Im trying to make chat rooms in my web app. That chat rooms will be protected by password. How to securly store that passwords?
I figure out that way:
- validation through my own api which only has access to that passwords.
I know there are firebase security rules that i can change but:
- do i have to make new collection? or do i am able to change security rules just for one field in document?
- how to make collection accesible just for api? I know that i can change in security rules that some data is only accesible for it's creator by how to make it for api?
Or is there better way to do that?
Solution 1:[1]
The simplest way I found is that you don’t have to store passwords in the Firestore, instead you can use Firebase Authentication for it.
You can create it by calling createUserWithEmailAndPassword, or you can also create new password-authenticated users from the Authentication section as mentioned in Manage Users in Firebase.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zeenath S N |
