[英]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.