I have been securely storing user data using a unique reference ID and their email address. I want to ensure that only authorized users can access this information by requiring them to provide both the ID and the registered email address.
In Firebase, the data is structured as follows:
{ "data" : {
"ms12345678" : {
"name" : "John Doe",
"age" : 40,
"email" : "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="92f8fdfafcf6fdf7d2f6fdfff3fbfcbcf1fdff">[email protected]</a>"
}
}
Attempting
var ref = firebase.database().ref("data/ms12345678")
will only succeed if accompanied by <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9cf6f3f4f2f8f3f9dcf8f3f1fdf5f2b2fff3f1">[email protected]</a>
.
I am considering different options for ensuring data security without requiring user authentication but providing them with a secure link.