Email provider in Firebase Auth - firebase

While creating a firebase user with an email and phone number, the Phone provider is automatically added. But how do I add an Email provider along with a Phone provider in Firebase? I have enabled both Phone and Email/Password providers under sign-in methods in the authentication section of the Firebase dashboard. Is there a function that can be invoked from the client or the server side to add the email provider option too?

Related

Flutter Authentication with Firebase email & email link

I'm writing the flutter app (ios/android) using firebase auth.
My app users are just signed up with their phone number at first.
I want my users' accounts link with their email.
Is there any way to send email which contains just code (not auth link) with firebase auth?
or is there any way to link users' accounts(phoneNumber auth) with their email?
Thanks!

How to prevent from firebase auth to change user provider - flutter firebase

I'm creating a flutter app with firebase.
I've added as one of my auth method, google sign in.
But if I register with the same email with an email and password,
and then sign in via google with the same email, firebase will change the provider of the user from email and password to google and when you'll try to login with email and password, the older password will not be vaild any more and you'll have to go through a password reset process.
How can I prevent firebase from changing the user provider?? Or how can check if this email is already registed in my firebase project (with the same email of course)???
Under authentication -> sign in methods
Activate: One account per email address.

social login using firebase with same provider gives "An account already exists with the same email address"

I implemented social login using firebase SDK and i tried login using my facebook account l got this error
An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address
Note
I have only facebook and twitter login in my app and my facebook email not have twitter
when I reviewed user at firebase console l already have user with this email that was registered by facebook (the same provider)
How can the same provider generate different credentials?
You get this error when the user already signed in with the same email using a different provider. eg. user signs up with Twitter using user#example.com and then signs in with Facebook using user#example.com.
Since one account per email is enabled in the project settings, the only way to recover in this case is to sign in with the first provider (Twitter in the example above) and then linkWithCredential the Facebook credential to the existing Twitter account. By doing so, the user can sign in to the same account with either provider in the future.
Firebase Auth does this for security reasons. They want to verify that this is the same user signing in and do not want to automatically link without verifying the user's ownership of both account.

Firebase Authentication Service

I want to set multiple authentication services. As if user either sign in with email and password or phone number, but I want user to signUp with both email and password and phone number.
In Firebase Authentication terms this means that you want the user to sign up with multiple authentication provider. This is possible, although you'll have to implement the flow for it in your own application code. You then can link the providers together through the Firebase Authentication API, so that the user ends up with a single ID.

Bug: Firebase Auth Google delete EmailPassword Auth

I already have user that register using email and password.
When the user log out, and then login with google that has the same email, the login success with the same userId from Auth, But the email password auth is disappeared (the envelope icon is gone). It's kind of replaced.
My App for SignIn has 3 buttons:
SignIn with Phone
SignIn with Email n Password
SignIn with Google
Let say I have user A that already sign up with :
email: awesomeA#gmail.com
pass: somepassword
And then the user A is for some reason sign out, then log in again using Google, but with the same email (awesomeA#gmail.com)
In Console Auth, userId A is same as before, but the icon in firebase Auth is only showing google, the icon for email password Auth is gone
NB: Why I use email password as primary auth? Because my app contains payment information. So if the device is being stolen, I want to make it secure using firebase re-authentification system. So as long as the thief doesn't know the password, he cannot use the virtual wallet to buy anything
If you send a verification email to the user with sendEmailVerfification(), and the user confirm it, it will be added to the providers instead of replacing it. Basically having a gmail email just means "verified" as well.
When you use Google login to authenticate with Firebase, you will never have access to the user's password. That is also true for other third-party logins that work with Firebase authentication (Facebook, Twitter).

Resources