-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Email is null for Google Sign-in for some accounts #1621
Comments
@davidvavra did those users previously log in with any other identity provider? |
@samtstern Those users could login before with Google provider. I'm suspecting that this issue is connected with 2 step verification. So far I have reproduced it on 3 Google accounts with 2 step verification turned on. Other accounts without it work. |
Hmmm @davidvavra ok a few more questions:
|
The accounts have it enabled, there is no 2FA flow during sign-in attempt. If I sign out and sign in, it's the same problem. I might have signed in with Facebook before just for testing purposes, but deleted the Facebook account from the Firebase console afterwards. Otherwise the library doesn't allow signing with Facebook if I used Google before (I have one account per email enabled) |
I did some additional testing and it looks like the 2FA is not the cause. I was able to sign in with newer accounts with 2FA turned on. Only thing which connects these accounts is that they are older - created in 2016. @samtstern |
Hmmm that is so strange. @lsirac @malcolmdeck any ideas? |
Hmm, can you check if there are duplicate accounts with the same email in the Firebase Console? |
@lsirac Yes that actually happened. These accounts had a duplicate Google account in the console. One of them wasn't used since 2016. But when I deleted this old account, the behavior is still the same - no email. |
What if you delete both accounts and sign in again? |
These are user production accounts, I can't delete them. |
I see. I'll ask my teammates if they have any ideas. |
I was experiencing this very issue a while ago (about the same time as the issue's date). What fixed it for me was changing this: List<AuthUI.IdpConfig> providers = Arrays.asList(
new AuthUI.IdpConfig.GoogleBuilder().build()); to this: GoogleSignInOptions googleOptions = new GoogleSignInOptions.Builder().requestId().requestEmail().requestProfile().build();
List<AuthUI.IdpConfig> providers = Arrays.asList(
new AuthUI.IdpConfig.GoogleBuilder().setSignInOptions(googleOptions).build()); It seemed as if I had to explicitly state I needed the email - after that I started getting the email addresses again. Hope it helps someone! |
@Velocity- thanks that's interesting! The default sign in options are:
So there's no @lsirac can you ask around your team and see if there are known cases where this would make a difference? Maybe we want to add |
I think we need to request the email - doesn't seem to cause a scope dialog. I just tried using the default options and I don't get an email back. |
The fix for this issue has been released in version |
Is there any method in react typescript to request for an email from firebase. Currently I am getting null in email parameter. |
After a successful Google sign-in, I'm getting null when calling
FirebaseAuth.getInstance().currentUser?.email
Other fields (displayName, uid) are there.This is how I launch the Auth UI:
It's strange, because I'm only getting this behavior for some Google accounts. Others are fine. I also see email in the Firebase Console for all accounts.
My "One account per email address" is set to "Prevent creation of multiple accounts with the same email address"
This started to happen after I updated the library from version to version 2.0.1 to version 4.3.2.
The text was updated successfully, but these errors were encountered: