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

查看:33
本文介绍了使用电话号码和密码的 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 注册/登录
  • 使用电子邮件/密码注册/登录
  • 使用电话号码/密码注册/登录

前两个没问题,我遵循了基本的教程.但是,电话号码/密码是这里的问题.Firebase 仅支持电话号码/短信令牌(称为电话身份验证),但没有提及我的情况.我不想破解 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-auth

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天全站免登陆