Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phone number based auth in Firebase (with Digits)

I am super impressed with the new Firebase and auth options in that. But what if I want to create my own userID-password system to create a user? Like for example I authenticate the user with his phone number (using something like Fabric's Digits) and use that to create an user account. Now, how can I do this in the new Google's firebase? Or is it even doable?

like image 521
Codevalley Avatar asked May 26 '16 05:05

Codevalley


People also ask

How do I add my phone number to Firebase authentication?

In the Firebase console, open the Authentication section. In the Sign in method tab, enable the Phone provider if you haven't already. Open the Phone numbers for testing accordion menu. Provide the phone number you want to test, for example: +1 650-555-3434.

How do I authenticate a phone number?

Phone number authentication is an authentication method in which a sender sends an SMS message to a receiver's phone. Then, the receiver logs into its phone with a one-time code provided in the SMS message.

Can I customize the Firebase OTP digits default 6 to 4 )?

Save this answer. Show activity on this post. There is currently no way to change the length of the verification code that Firebase uses.

How do I change my Firebase phone number?

On the Firebase Console, select the "Phone" authentication provider and click on the "Phone numbers for testing" dropdown. Enter a new phone number (e.g. +44 7444 555666 ) and a test code (e.g. 123456 ).


1 Answers

Right now it cannot be done directly, but you could validate the user with Digits, send the security headers to a backend Web Service you developed in which you can create a email/password user using as email [email protected] and as password a string you randomly created, and using firebase custom authentication to give your end users tokens to reauthenticate, all this would seem as phone authentication to the end user, and he would'n even know he is using a email/password auth to sign in

like image 146
Ymmanuel Avatar answered Oct 25 '22 15:10

Ymmanuel