gpt4 book ai didi

android - Firebase 身份验证 : Re-authenticate user who is using custom token

转载 作者:行者123 更新时间:2023-11-29 16:46:38 25 4
gpt4 key购买 nike

在 Android 应用程序中,允许用户使用 Linkedin 作为使用 Firebase 函数的登录选项。用户将 linkedin token 发送到 firebase 函数,结果它收到生成的 AdminSdk Custom token .

现在我们知道 token 可以用于登录mAuth.signInWithCustomToken(mCustomToken)。但是我找不到使用自定义 token 生成 AuthCredential 的方法。

OAuthProvider可以生成 AuthCredential 但重认证失败的类。getCredential(字符串 providerId,字符串 idToken,字符串 accessToken)

这个问题有什么解决办法吗?

最佳答案

不幸的是,Firebase Auth 不提供使用自定义 token 重新进行身份验证的方法。您可以将此作为功能请求:https://firebase.google.com/support/contact/bugs-features/

现在,您基本上必须再次使用 signInWithCustomToken。但是,您将注销原始用户,并且还存在用户使用其他帐户登录的风险。您需要保留原始 uid 以确认新登录用户是同一用户(具有相同的 uid)。如果同一用户再次登录,您还必须获取对当前用户的新引用。

关于android - Firebase 身份验证 : Re-authenticate user who is using custom token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47715716/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com