使用电话号码和密码的Firebase身份验证 [英] Firebase Auth using phone number and password

查看:189
本文介绍了使用电话号码和密码的Firebase身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase开发Android应用.因此,我想使用Firebase Auth.我有以下要求:

I am developing Android app using Firebase. Because of that, I want to use Firebase Auth. I have following requirements:

  • 使用Facebook注册/登录
  • 使用电子邮件/密码注册/登录
  • 使用电话号码/密码
  • 注册/登录
  • Register/Log in using Facebook
  • Register/Log in using Email/Password
  • Register/Log in using Phone Number/Password

前两个都可以,我遵循了基本的教程.但是,电话号码/密码是这里的问题. Firebase为此仅支持电话号码/SMS令牌"(称为电话验证"),但是没有提及我的情况.我不想破解Firebase并使用其实时数据库代替Auth'database'.有没有更好的方法来实现这一目标?

The first two are OK, I followed basic tutorials. However, Phone Number / Password is the problem here. Firebase supports only Phone Number/SMS Token for this (its called Phone Auth), but there is no mention about my case. I do not want to hack Firebase and use its realtime database instead of Auth 'database'. Is there any better way to achieve this?

谢谢.

推荐答案

Firebase电话身份验证正在使用OTP(一次性密码).这样,用户就无需麻烦记住密码.一旦通过身份验证,您将被注册.短信代码用作密码.但这是一次.通常,用户喜欢这种无需记住密码的行为.如果您仍在寻找所需的方式,请参阅此链接并创建自定义身份验证方法. https://firebase.google.com/docs/auth/android/custom-验证

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

这篇关于使用电话号码和密码的Firebase身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆