Automatic deletion of anonymous Firebase accounts

可紊 提交于 2019-12-08 13:33:15

问题


I use Firebase Database and Storage to host some pictures for my Android app. Those pictures are only uploaded by me from the Firebase web interface. The Database and Storage have rules so only authenticated users can read and nobody is allowed to write. (So there is NO user generated content, I just need a place to host graphics for my Android app).

The reason authentication is required for read access is to make sure nobody else uses the pictures in another app (or website). For the authentication I create (only) anonymous accounts. (They are created automatically on first app start).

My question is about the anonymous user accounts: Will these ever be deleted when they aren't used anymore? Every time I clear data (or reinstall) my app, then another anonymous user account is created.

Is this something I should worry about or is this normal behaviour? Is there anything I could improve in my situation? Please note that this part of my app is not yet live for all users, so I can change stuff if needed.


回答1:


Firebase Authentication does not automatically delete accounts.

But no data is maintained on the server for anonymous accounts, so effectively every time your users lose their anonymous authentication token, that account is forgotten by Firebase Authentication.




回答2:


You can use Cloud Functions for Firebase along with some scheduling mechanism to periodically delete unused accounts. There is sample code on GitHub.



来源:https://stackoverflow.com/questions/44119301/automatic-deletion-of-anonymous-firebase-accounts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!