简体   繁体   English

Flutter:将 Facebook 帐户与现有用户关联

[英]Flutter: Link Facebook account with existing user

Cases:案例:

  1. Sign in with facebook (working)使用facebook(工作)登录

  2. Sign in with google with same credetials, firebase overrides login provider (working)使用相同的凭证登录谷歌,firebase 覆盖登录提供商(工作)

  3. Now again sign in with facebook, firebase doesn't let me sign in and throws the exception:现在再次使用 facebook 登录,firebase 不让我登录并抛出异常:

    [firebase_auth/account-exists-with-different-credential] An account already exists with the same email address but different sign-in credentials. [firebase_auth/account-exists-with-different-credential] 已存在具有相同 email 地址但登录凭据不同的帐户。 Sign in using a provider associated with this email address.使用与此 email 地址关联的提供商登录。

I'm working with Flutter. As it can be fixed with signInWithPopUp or SignInWithRedirect , but these functions don't work with Flutter (only available for web).我正在使用 Flutter。因为它可以通过signInWithPopUpSignInWithRedirect ,但这些功能不适用于 Flutter(仅适用于网络)。

Is there any workaround to get it done?有没有解决方法来完成它?

If you want to be able to sign in with both providers, then in step 2 you need to link the second provider to the existing account rather than replace the Facebook account.如果您希望能够使用这两个提供商登录,那么在第 2 步中,您需要 将第二个提供商链接到现有帐户,而不是替换 Facebook 帐户。 To detect that you need to do that, you can call the fetchSignInMethodsForEmail method to find whether there's an existing account for the user's email address.要检测您是否需要这样做,您可以调用fetchSignInMethodsForEmail方法来查找用户的 email 地址是否存在现有帐户。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 flutter 上删除用户数据时如何删除 firebase 帐户? - How to delete firebase account when user data is deleted on flutter? Flutter:检查OTP认证后是现有用户还是新用户 - Flutter: Check if existing user or new user after OTP Authentication Flutter:如何获取 Apple 凭据以将 Apple 帐户链接到我的 firebase 应用程序上的帐户? - Flutter: how do I get Apple credential to link an apple account to an account on my firebase app? Actions on Google - 要求用户在令牌过期前重新链接他们的帐户 - Actions on Google - Ask user to re link their account before token expires Flutter Firebase:当用户尝试注册一个已经存在的 email 时出错 - Flutter Firebase: Error when user tries to register with an already existing email Firebase 在 flutter 中没有 email 链接的情况下在应用程序中重置用户密码? - Firebase reset user password in app without email link in flutter? 如何将我的 flutter 应用程序链接与我在 whastapp 上的推荐代码分享给另一个用户,当该用户单击该链接链接时用户重定向到 Play 商店 - how to share my flutter app link with my referaal code on whastapp to another user,when that user click on that link link user redirect to play store 使用 flutter firebase 创建帐户 - Create account using flutter firebase flutter 同号注册 - flutter sign up with same account 删除其他 firebase 身份验证帐户并将该密钥链接到新的身份验证帐户 - Delete other firebase authentication account and link that key to new authentication account
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM