Skip to content
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

Retrieve User email from Google and Facebook Providers #199

Closed
davidgcalle opened this issue Jun 26, 2016 · 2 comments
Closed

Retrieve User email from Google and Facebook Providers #199

davidgcalle opened this issue Jun 26, 2016 · 2 comments
Labels

Comments

@davidgcalle
Copy link

davidgcalle commented Jun 26, 2016

I need to allow multiple accounts and if one has Email and password auth, and later wants to sign in with facebook or google, I need to retrieve the user Email and assing the result info to my user data.

As mentioned on here #181, says that I can retrieve it from AccesToken and GoogleSignInAccount, but don´t see how, could please clarify that.
Thanks

@alfongj alfongj added the auth label Aug 2, 2016
@samtstern
Copy link
Contributor

@davidgcalle I am just seeing this issue now, sorry about the very long delay. Could you please explain this request in a little more detail? I'm not quite sure what you are trying to achieve.

@SUPERCILEX
Copy link
Collaborator

If the user signs up with email@example.com and has a Facebook or Google account with that same email address, the user id will be the same and you can just retrieve the email with FirebaseAuth.getInstance().getCurrentUser().getEmail();.

If you are referring to the user having two different emails addresses count as one, that's not possible at the moment. For example, a user cannot sign up with email@example.com and then later on do so using Facebook or Google with another.email@example.com. To my knowledge, this would be considered two different user accounts with two different user ids.

I'm actually working on a feature that lets you link accounts together: I have it set up so that you can add a linkWithCurrentUser() option to the SignInIntentBuilder() to easily link accounts together (including anonymous authentication). If this is what you are looking for, either I'll get it done sometime soon in my spare time, or someone else will get around to it before 1.0.0 (hopefully).

@alfongj alfongj closed this as completed Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants