Firebase Facebook Twitter Providers getEmail null

531 views
Skip to first unread message

tuğba kaya

unread,
Feb 22, 2017, 10:41:16 AM2/22/17
to Firebase Google Group

I am developing an Android app with Firebase. I authenticate user with Email, Facebook, Twitter accounts. The problem is I have the permissions for Facebook and Twitter getting the email.

I can get the email and in the Firebase console, I can see the related Emails for Facebook and Twitter. But in the app, I cannot get the email of Facebook and Twitter accounts. I looked at the all provider data of user.

Like follows:

user = mAuth.getCurrentUser();
//First provider is firebase all the time
user.getProviderData().get(1).getProviderId() = "twitter.com"
user.getProviderData().get(1).getEmail() = null
user.getEmail() = null

Jacob Wenger

unread,
Feb 22, 2017, 11:21:07 AM2/22/17
to fireba...@googlegroups.com
Hey there,

Are you using "Multiple accounts per email" setting in the Firebase console (bottom of this page)? If so this is expected for OAuth providers. The top level email is not set and only the email for the relevant provider is available. If you switch to "one account per email" in the console, the email will be populated.

Cheers,
Jacob 

--
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-talk+unsubscribe@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/765ef52f-6ae1-46d3-8ee9-05d0f36fccbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tuğba kaya

unread,
Feb 23, 2017, 9:43:15 AM2/23/17
to Firebase Google Group
I am using the "Allow creation of multiple accounts with the same email address" option already. If a user login with facebook, I can see the email on the console, but in the code I cannot get any email.

On Wednesday, February 22, 2017 at 7:21:07 PM UTC+3, Jacob Wenger wrote:
Hey there,

Are you using "Multiple accounts per email" setting in the Firebase console (bottom of this page)? If so this is expected for OAuth providers. The top level email is not set and only the email for the relevant provider is available. If you switch to "one account per email" in the console, the email will be populated.

Cheers,
Jacob 
On Wed, Feb 22, 2017 at 3:17 AM, tuğba kaya <kayaa...@gmail.com> wrote:

I am developing an Android app with Firebase. I authenticate user with Email, Facebook, Twitter accounts. The problem is I have the permissions for Facebook and Twitter getting the email.

I can get the email and in the Firebase console, I can see the related Emails for Facebook and Twitter. But in the app, I cannot get the email of Facebook and Twitter accounts. I looked at the all provider data of user.

Like follows:

user = mAuth.getCurrentUser();
//First provider is firebase all the time
user.getProviderData().get(1).getProviderId() = "twitter.com"
user.getProviderData().get(1).getEmail() = null
user.getEmail() = null

--
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.

Jacob Wenger

unread,
Feb 23, 2017, 1:10:25 PM2/23/17
to fireba...@googlegroups.com
Hey there,

If you have the "Allow creation of multiple accounts with the same email address" setting enabled, then this is expected behavior. If you turn off that setting, you should see the email field populated.

Cheers,
Jacob

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

tuğba kaya

unread,
Feb 28, 2017, 10:22:20 AM2/28/17
to Firebase Google Group
Thank you. You are right, when I do the setting, I can get user email with user.getEmail(). But just for the curiosity, is it normal to see providers email null even if in this case. For example, I logged in with facebook. I can see the email with user.getEmail which is got from facebook, but the providerData (facebook) email is null.
Reply all
Reply to author
Forward
0 new messages