【问题标题】:firebase-admin python sending password reset emailfirebase-admin python 发送密码重置邮件
【发布时间】:2019-07-26 11:30:11
【问题描述】:

在 Python 中,我正在尝试“发送密码重置电子邮件”,javascript 参考 (https://firebase.google.com/docs/reference/js/firebase.auth.Auth#sendPasswordResetEmail)。到目前为止(并且只是最近),似乎添加了“生成密码重置链接”(https://github.com/firebase/firebase-admin-python/releases)。有谁知道发送电子邮件的下一步?我们自己发送电子邮件吗?如果是这样,有什么建议吗?有没有办法直接用python发送邮件?

提前感谢您的所有帮助!

【问题讨论】:

    标签: python python-3.x firebase firebase-admin


    【解决方案1】:

    感谢 Github 上的 (bojeil-google) 提供答案。显然,这样做的方法是根据 https://firebase.google.com/docs/reference/rest/auth/#section-send-password-reset-email 发出 POST 请求。在 python SDK 中没有直接调用来执行此操作。再次感谢!

    【讨论】:

      【解决方案2】:

      Firebase-admin-sdk (python) 缺乏处理用户身份验证的方法。您可以使用Pyrebase。它是 firebase API 的包装器。

      【讨论】:

        【解决方案3】:

        可能会迟到,但要让其他人看到:

        email = 'user@example.com'
        link = auth.generate_password_reset_link(email, action_code_settings)
        # Construct password reset email from a template embedding the link, and send
        # using a custom SMTP server.
        send_custom_email(email, link)
        

        更多内容在这里:https://firebase.google.com/docs/auth/admin/email-action-links#python_1

        【讨论】:

          猜你喜欢
          • 2015-08-13
          • 2015-11-26
          • 1970-01-01
          • 2018-11-02
          • 2013-12-18
          • 2017-08-31
          • 2013-10-13
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多