【问题标题】:How to allow email id to receive OTP in firebase for authentication如何允许电子邮件 ID 在 Firebase 中接收 OTP 以进行身份​​验证
【发布时间】:2018-06-21 06:20:07
【问题描述】:

我正在开发一个应用程序,用户可以使用电子邮件和电话进行注册。

用户可以输入他们的电子邮件或电话进行登录,我希望将相同的 OTP 同时发送到手机和电子邮件。请帮忙!

【问题讨论】:

  • 请查看此链接,了解如何在 StackOverflow 中提问:stackoverflow.com/help/how-to-ask 显示您尝试过的内容、失败的内容、添加代码 sn-ps 等。
  • 通过短信验证 OTP 很简单,电子邮件验证链接也是如此。 OP 询问如何将 OTP 与 SMS 一起发送到电子邮件。 @Gerardo
  • 可能是this 可以帮忙。
  • 无法使用 firebase auth otp 验证。

标签: android firebase firebase-authentication


【解决方案1】:

如果您只想使用Firebase Authentication,,那么没有任何合适的解决方案可以满足您的要求。

Firebase 的一些限制是 Firebase Authentication LimitsPhone number sign-in limits.

但是,替代解决方案是使用第三方 SMS 网关。通过与您可以同时发送 OTP 到电话号码以及电子邮件。

【讨论】:

    【解决方案2】:

    假设您已经拥有生成 OTP 并从 android 应用验证 OTP 的机制。

    现在的问题是如何将 OTP 发送到用户的电子邮件。 一种解决方案是使用MailGun 服务从您的后端发送电子邮件。

    另外,如果你想模板化你的电子邮件,你可以使用名为handlebar的库

    【讨论】:

    • 我希望将同一个 OTP 同时发送到手机和电子邮件。
    • 如果您的意思是来自 firebase 手机身份验证的 OTP,那么我们无法将其发送到用户的电子邮件,因为它是 firebase 特权,我们不能乱用它。
    猜你喜欢
    • 1970-01-01
    • 2021-12-16
    • 2019-05-20
    • 2023-03-18
    • 2020-03-24
    • 1970-01-01
    • 2022-08-07
    • 2018-02-10
    • 2019-06-25
    相关资源
    最近更新 更多