Firebase anonymous auth - persistent

210 views
Skip to first unread message

Paul

unread,
Mar 7, 2019, 9:52:13 AM3/7/19
to Firebase Google Group
Hello,

I have a question about persistent anonymous auth. My use case is an app which uses Firebase anonymous auth by default, but offers players the ability to log in as well. There will always be players who do not log in, and having the anonymous UID allows us to maintain a profile for this player in firebase. When a player upgrades from anonymous auth to Google/Twitter/Facebook etc, I can keep the same Firebase UID and everything works well. The problem arises when an authenticated player, Signs Out of their account. At this point, when they re-lauch the app, they don't have an account, so they log in as anonymous again. The issue is I get a new anonymous UID for them. Is this the expected behaviour? It is possible to maintain their previous anonymous uid.

Paul

Samuel Stern

unread,
Mar 7, 2019, 11:45:38 AM3/7/19
to fireba...@googlegroups.com
Hey Paul,

This is the expected behavior.  There is no way to log back in to the "same" anonymous auth account once you have logged out of it.  This also means you can't share the same anonymous auth account across devices.  If you want this to be persistent you may want to consider creating your own fake anonymous auth by making a custom auth token (on your server) for the user and creating some system that allows them to retrieve the same token multiple times on the same device.

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/59775b1d-c6d6-462c-9402-fb61d70acea3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul

unread,
Mar 8, 2019, 11:06:36 AM3/8/19
to Firebase Google Group

Thanks Sam - that's great advice. I'll look in to making my own JWT token from another identifier I have.
Cheers

Paul
Reply all
Reply to author
Forward
0 new messages