Thanks for your reply, the use case is as following:
I have App-A and App-B and I want them to communicate through firebase, but App-A decides which users of App-B will be able to do it. So App-B users sign up/in using email sign in and I don't know beforehand their uid to create the DB before.
So one option is to save App-B available contacts under directory, and to define permissions I use the email address as identification, but I wouldn't like to store the emails in order to avoid PII saved in my DB so I'd rather save the hash of the email.
On Thursday, January 17, 2019 at 11:15:42 PM UTC+2, Doug Stevenson wrote:
Typically you use the uid of the authenticated user to authorize access to parts of the database. The database would use the uid as an organizer, so it would be present as the name of a node (in Realtime Database) or document (in Firestore) that you can easily find.
Email addresses can change over time, but the uid always stays the same for a given user account. Is the uid sufficient, or do you really need to use email address? If you do need email address, could you explain your use case?
Doug
On Thursday, January 17, 2019 at 7:23:50 AM UTC-8, Michael G wrote:
Hi,I would like to validate that an authenticated user's email is the only one accesses its directory. I would like to store in the DB only hash of users email and validate it in the rules.
for example:
root
and then validate in security rules that only sha(auth.email) can access its directory.
Is there a way to do it somehow?