Skip to content

Getting the PhoneAuthCredential #1235

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
AmoghBhagwat opened this issue Apr 1, 2018 · 9 comments
Closed

Getting the PhoneAuthCredential #1235

AmoghBhagwat opened this issue Apr 1, 2018 · 9 comments

Comments

@AmoghBhagwat
Copy link

How can we get the PhoneAuthCredential object to link the account with email providers?

@jeffy2007
Copy link

I am facing this problem too.

The scenario i am using now is:
-Login with social account e.g. Google or Facebook login
-After social login successfully, prompt user with Phone Authentication
-If Phone Authentication success, link the social account with phone account

I find out that we could implement a method under PhoneActivity to return a phoneAuthCredential before the sign in method. But currently I have no idea how to install this repo locally :(

@samtstern
Copy link
Contributor

@jeffy2007 can you explain your use case a little more? Do you want your users to use a social login but then add a phone number to their account?

The issue with the PhoneAuthCredential is that it is not re-usable. So once FirebaseUI has used it, it wouldn't do you any good.

@jeffy2007
Copy link

@samtstern Yes, after the social login i want to let my user to do a phone authentication and add their phone number to their account.

For the PhoneAuthCredential, i would like to return it immediately in PhoneActivity instead of signIn, since for my project I don't really a phone account.

@samtstern
Copy link
Contributor

@jeffy2007 understood, that's an interesting use case that we had not thought of. It's possible but won't be simple to implement so we'll have to consider the implications!

@SUPERCILEX
Copy link
Collaborator

@samtstern I'm not sure that makes sense for us to do since FUI is supposed to handle all of that internally. The account linking fork can already do this by using linkWithCredential with an integrated flow and all that.

PS: @jeffy2007 have a look at #123 and the instructions. Also, the latest commit is 3eb4c1373a.

@samtstern
Copy link
Contributor

@SUPERCILEX I agree, this is not likely. I would much rather land generalized account linking.

@jeffy2007
Copy link

@SUPERCILEX Hi, Thanks for your reply.
I went through your repo, here is my assumption for my case.

  1. User login with Google/Facebook successfully.
  2. After step 1, user was prompted with Phone Authentication with setIsAccountLinkingEnabled(true, Class)
  3. The social account logged in step 1 will link with the phone account in step 2 automatically

Please correct me if any mistake.

@SUPERCILEX
Copy link
Collaborator

@jeffy2007 bingo! It's that simple 😁

@samtstern
Copy link
Contributor

Going to close this bug for now and try to address any use case here through future account linking support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants