Skip to content

FirebaseAuth.getInstance().getCurrentUser().getUid() returning numbers in place of actual user id #1927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gitton opened this issue Sep 1, 2020 · 9 comments

Comments

@gitton
Copy link

gitton commented Sep 1, 2020

[REQUIRED] Step 2: Describe your environment

com.google.firebase:firebase-auth:19.2.0

[REQUIRED] Step 3: Describe the problem

Using FirebaseAuth.getInstance().getCurrentUser().getUid() to get the user id of the user. This method is returning numbers instead of the actual user id in some case. Also, we find the users token is still valid but the user id returning from the SDK is of number example: 101528418014522522531

Steps to reproduce:

Sorry, not able to reproduce the issue and was got from Crashlytics for some users

Relevant Code:

 FirebaseAuth.getInstance().getCurrentUser().getUid()
@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@malcolmdeck
Copy link
Contributor

Hey gitton,

I've filed b/169072058 to track this internally. This is really weird - if you stumble across any insight as to when this happens, that would be very useful.

Thanks,
~Malcolm

@sam-gc
Copy link
Contributor

sam-gc commented Sep 23, 2020

One more question-- how often is this showing up in Crashlytics?

@gitton
Copy link
Author

gitton commented Sep 24, 2020

Last 90 days we had seen this had affected around 150 users. @samhorlbeck

@sam-gc
Copy link
Contributor

sam-gc commented Sep 24, 2020

Okay thanks, I'll update the tracking bug with that info

@pberrospi
Copy link

pberrospi commented Oct 8, 2020

Hi,
I have the same problem to get the ID of the profile of Facebook and use it to get the picture of the profile. It returns https://graph.facebook.com/10223852407640502/picture and it is the same which other providers.

My id is 1304770240, not this 10223852407640502.

I used to use the version: com.google.firebase:firebase-auth:19.4.0.

Problem in this code
Error Firebase

FirebaseAuth.getInstance().getCurrentUser().getUid()

@malcolmdeck
Copy link
Contributor

Ok, for the initial issue, this may be true for some users if they were created by the Admin SDK - you can set any UID there. I haven't been able to reproduce this issue at all, so if we can't find any more information on what types of users this is affecting or where those other IDs may be coming from, I don't really know how to proceed here.

As for the issue you're talking about pberrospi, I'm not sure that that's the Firebase UID. It appears to perhaps be the Facebook UID, given that that photoURL is, in fact, a valid Facebook Photo URL. I'm unsure of how one would map to the other - if you have any steps on how to reproduce your issue, please let me know

@pberrospi
Copy link

Ok, for the initial issue, this may be true for some users if they were created by the Admin SDK - you can set any UID there. I haven't been able to reproduce this issue at all, so if we can't find any more information on what types of users this is affecting or where those other IDs may be coming from, I don't really know how to proceed here.

As for the issue you're talking about pberrospi, I'm not sure that that's the Firebase UID. It appears to perhaps be the Facebook UID, given that that photoURL is, in fact, a valid Facebook Photo URL. I'm unsure of how one would map to the other - if you have any steps on how to reproduce your issue, please let me know

I don't know if the issue was corrected but currently it is working good and the issue is not happen again.

Thanks.

@malcolmdeck
Copy link
Contributor

I'm glad to hear it - I'll close this issue, then :)

@firebase firebase locked and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants