firebasegoogle-cloud-platformfirebase-authenticationanonymous-users

Using Firebase Anonymous Auth as only authentication method in app


I have the following mobile app scenario based on a Firebase backend:

It seems Firebase Anonymous Auth is a perfect match for this scenario - but the documentation hints that it should only be used as a temporary solution until users create an actual account. Are there any drawbacks to using anonymous auth as the sole authentication method for the solution? The alternatives I see are some kind of hack using a custom token-based login or perhaps email/password auth.


Solution

  • Are there any drawbacks to using anonymous auth as the sole authentication method for the solution?

    There isn't unless the user uninstalls the app.

    The documentation hints that it should only be used as a temporary solution until users create an actual account.

    Why a temporary solution? It's because anonymous accounts do not persist across application uninstalls. If a user uninstalls the app, everything that was saved locally will be deleted, including the anonymous auth token that identifies that account. Unfortunately, there is no way to reclaim that token for the user.

    The alternatives I see are some kind of hack using a custom token-based login or perhaps email/password auth.

    IMHO, the best approach would be to use anonymous authentication but to also let the user the possibility to link their account with email and password or any other providers, like Google, Facebook, Instagram, and so on.