1

Recently I'm noticing that some Android Samsung devices using Firebase authentication have changed their user UIDs from letters and numbers (for example: A123fASDFij123t9iasdflj112fd) to only numbers (for example: 149124123419287364123).

This is quite puzzling, because I thought Firebase authentication UIDs are constant and shouldn't change.

The reports I've gotten are from Samsung users, in particular running Android 12. Is there something on that OS that might be causing this issue, such as anonymizing Firebase authentication IDs in a different way?

I am getting the Firebase authentication UID as follows:

FirebaseAuth.getInstance().currentUser.element.uid

Edit: Was reading through this post in 2015, which Google announced they're changing from integer uid to GUID format. So it's possible some of my users are using multiple devices, and some of those devices had a uid set from 2015 or prior, which might be causing a conflict in multi device scenarios. Maybe that's one possible explanation. https://groups.google.com/g/firebase-talk/c/s9mv4S46Qs0

mliu
  • 1,708
  • 15
  • 26
  • 1
    *firebaser here* I'm not aware of anything Samsung-specific in the way we generate UIDs. Can you show a [minimal repro](http://stackoverflow.com/help/mcve) for the problem though? That would make it much more likely we can figure out what's going on for those users. – Frank van Puffelen Jul 01 '22 at 14:20
  • This issue only reproduces on about 5 of my users out of around 5,000, so I don't have a repro, and I'm trying to figure out where these number-only IDs are being generated from. Does firebase generate UIDs on client side or server side? – mliu Jul 02 '22 at 06:38
  • One thought I have is that some of these IDs are generated on older devices (pre 2015), and the newer android devices later on are generating GUID IDs, but the users still have their old phones which are using integer based IDs. So when the user switches phones, their IDs use the old format, but their newer phones use the newer guid format, and my server gets confused on why the same user has multiple IDs for the same account. – mliu Jul 02 '22 at 06:39
  • 2
    If they sign in with the same credentials to the same Firebase project they should be getting the same UID, regardless of the device they use. – Frank van Puffelen Jul 02 '22 at 13:54

0 Answers0