I have a simple Firebase realtime database, just PUT/GET. It all works. But security is confusing to me.
I want to make sure only my app (with authentication) uses the database. The gotcha is the ?auth=
:
https://<firebase url>/samarkand/<userID>/appState.json?auth=
It might be relevant that I am using my own userID, not a Firebase id_token (which is huge). Is that a mistake?
What works for auth= is my Firebase database secret, but the page listing that says it is deprecated. I have tried using the access_token, id_token, serverAuthCode, authCode returned from the login.
My database rule is:
{
"rules": {
"samarkand": {
"$uid": {
// Allow only authenticated content owners
".read": "auth !== null",
".write": "auth !== null",
}
}
}
}
I think the secret just overrides that security. What am I missing?