【问题标题】:Firebase Authentication with custom unsupported providers使用不受支持的自定义提供程序进行 Firebase 身份验证
【发布时间】:2017-03-27 03:39:13
【问题描述】:

是否可以与不受支持的自定义(不是 Google、Facebook、Twitter 和 Github)提供商进行身份验证或链接?

例如,我有兴趣让我的用户使用 Linkedin 或 Flickr 登录。我不拥有他们的 API,所以我不能使用文档中描述的 custom token

链接需要使用 AuthCredential,但我还没有找到有关如何为新服务构建自定义 AuthCredential 的示例。

解决此问题的可行解决方案是什么?客户端上firebaseAuthTokenunsupportedProviderAuthToken之间的自定义映射?

【问题讨论】:

    标签: android firebase firebase-authentication


    【解决方案1】:

    您可以通过实现所谓的自定义身份验证提供程序将任何身份提供程序添加到 Firebase 身份验证。

    为此,您需要在受信任的环境(通常是应用服务器)上运行代码。此代码需要执行实际身份验证,然后使用用户信息生成 JSON Web 令牌 (JWT)。请参阅Firebase documentation on creating custom tokens

    然后在安卓应用中,你use the custom JWT to authenticate the user with Firebase

    Firebase 博客上也有一些很好的例子:

    【讨论】:

      猜你喜欢
      • 2017-02-21
      • 2021-01-03
      • 2012-04-05
      • 1970-01-01
      • 2019-10-10
      • 2012-11-09
      • 2021-12-12
      • 2014-09-28
      相关资源
      最近更新 更多