Firebase Auth using phone number and password

☆樱花仙子☆ 提交于 2019-12-04 10:16:34

Firebase phone authentication is using OTP(one time password). This way there is no hassle for the user to remember the password. Once authenticated, you will be registered. The sms code acts as a password. But that is for one time. Usually , users prefer such behaviour in which you dont have to remember the passwords. If you are still looking for the way you want, see this link and create a custom authentication method. https://firebase.google.com/docs/auth/android/custom-auth

I had a similar problem - I combined firebase auth(email + password) with (phone+otp) to get phone+password auth -

https://medium.com/@shivampesitbng/firebase-phone-password-auth-in-vue-b94f15b8fb3d

If you have both email and phone of your user and you can use Admin SDK, then perhaps you could exchange users phone number to his email and login with email and password in the background.

Something like this (node.js)

admin.auth().getUserByPhoneNumber(phoneNumber)
    .then(user => {
        firebase.auth().signInWithEmailAndPassword(user.email, password);
    });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!