Rectangle 27 0

Phone number based auth in Firebase (with Digits)?


Good answer, Care to share a sample strategy, say maybe with web and node.js on the backend?

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 phone_number@yourdomain.com 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

Since the firebase upgrade you cannot use the email method described above, mainly because they changed the way createUser works, but you can actually create a nodejs backend (example express js) set up the server as it is described in firebase documentation and use the digits authentication mixed with the firebase custom token to associate an UID to a phone number

Note