简体   繁体   English

Firebase - 如何取消自定义提供商与帐户的链接

[英]Firebase - How to unlink a custom provider from a account

I'm using the Firebase plugin in Unity for authentication.我在 Unity 中使用 Firebase 插件进行身份验证。 I have an account that authenticates with the standard providers (email, apple, etc) and can also link their Twitch account.我有一个通过标准提供商(电子邮件、苹果等)进行身份验证的帐户,还可以链接他们的 Twitch 帐户。 The Twitch account linking is done through a custom provider. Twitch 帐户链接是通过自定义提供商完成的。 This is tracked in a separate table to keep track of which accounts are linked to Twitch.这是在一个单独的表中跟踪的,以跟踪哪些帐户链接到 Twitch。

The problem I am having is with unlinking the Twitch account.我遇到的问题是取消链接 Twitch 帐户。 Custom providers don't have a provider id so from the client I'm unable to unlink it.自定义提供商没有提供商 ID,因此我无法从客户端取消链接。

I've checked FirebaseUser.ProviderData to see if anything was there to maybe pass into the unlink call.我检查了FirebaseUser.ProviderData以查看是否有任何内容可以传递到取消链接调用中。 I've also passed in the provider id I supplied the credential with, but get this error message: FirebaseException: User was not linked to an account with the given provider.我还传入了提供凭据的提供商 ID,但收到此错误消息: FirebaseException: User was not linked to an account with the given provider.

How do I unlink a custom provider?如何取消链接自定义提供商?

In the end I believe my issue was not understanding how the custom providers worked well enough.最后,我认为我的问题是不了解自定义提供程序如何足够好地工作。 Deleting the entry in the table we keep separately was sufficient enough to un-link the account.删除我们单独保存的表中的条目足以取消链接帐户。

Worth noting when you delete an account you need to ensure you delete your entry too.值得注意的是,当您删除一个帐户时,您需要确保您也删除了您的条目。 Also if the account only has custom providers the providers list will be empty.此外,如果帐户只有自定义提供者,则提供者列表将为空。 So you can't rely on that if you had been for an anonymous account or things like that.因此,如果您使用的是匿名帐户或类似的东西,就不能依赖它。

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

相关问题 Firebase 身份验证:如何知道 Google 或 Facebook 提供商的帐户是否已经存在? - Firebase Authentication: How to know if account with Google or Facebook provider already exist? Firebase Auth - 没有来自谷歌登录提供商的电子邮件 - Firebase Auth - no email from google sign in provider 防止 Firebase 验证电话创建帐户 - prevent Firebase verify phone from creating account 如何使用 where 子句从 firebase 正确获取数据,并使用 flutter 从 firebase 中正确获取数据 - How to correctly fetch data from firebase using where clauses and custom filters from firebase using flutter 如何在 firebase 身份验证中禁用帐户创建 - How to disable account creation in firebase authentication 无法从 firebase 登录谷歌帐户 - Can't login into google account from firebase 如何使用 Go 从 firebase 应用程序创建的服务帐户生成访问令牌 - How to generate an access token from a service account created from firebase app using Go 如何在 firebase 身份验证电子邮件提供商注册中禁止使用一次性电子邮件? - How to disallow disposable email in firebase auth email provider signup? 如何在 Firebase 中设置自定义用户名? - How to set a custom username in Firebase? 如何使用 firebase 管理员 SDK 创建具有社交提供者的租户? - How can I create a tenant with social provider with firebase admin SDK?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM