【问题标题】:Firebase authentication with backend in androidandroid中带有后端的Firebase身份验证
【发布时间】:2020-08-11 01:53:56
【问题描述】:

我计划使用 Firebase 进行身份验证并为我的 Android 应用构建聊天功能。但我有其余 API 的自定义后端。 我们可以同时使用自定义后端和 firebase 身份验证吗?

【问题讨论】:

    标签: php android firebase


    【解决方案1】:

    当然。您需要:

    1. Sign the user in with Firebase Authentication in your app
    2. 通过安全连接传递user's ID token from the app to your server
    3. Decode and validate the ID token.
    4. 确保用户有权执行他们尝试执行的操作。

    【讨论】:

    • 我已经使用服务器 API 进行身份验证,这是他们将此服务器与 firebase 连接的任何方式,而不是将应用程序与 firebase 连接
    • 您希望服务器与 Firebase 做什么?
    • 使用服务器进行身份验证并使用身份验证令牌登录firebase以便能够在不使用服务器的情况下与firebase进行聊天。
    • 我不确定我是否理解正确,但如果您想在服务器上创建自定义令牌,然后用于将用户登录到 Firebase,请参阅 firebase.google.com/docs/auth/admin/create-custom-tokens
    猜你喜欢
    • 2019-05-17
    • 2023-02-24
    • 2019-01-08
    • 1970-01-01
    • 2019-02-26
    • 1970-01-01
    • 2020-12-31
    • 2019-01-14
    • 2017-11-27
    相关资源
    最近更新 更多