Can the Firebase auth object handle simultaneous authentication types?

后端 未结 1 1297
孤城傲影
孤城傲影 2021-01-14 03:00

This post describes how to tie multiple accounts to a single $uid in a users collection.

Here\'s those security rules:

相关标签:
1条回答
  • 2021-01-14 03:38

    If you want to tie multiple accounts to a single uid, you'll need to generate your own tokens.

    You could, for example, use Firebase.push to generate unique ids for each user, and use those in your tokens. This is no simple matter as it requires that you have:

    • a way to store the user's ID independent of authentication method (a cookie?)
    • a way to link auth accounts together when using a diff computer

    In many use cases, this could even counter-productive; users will log in with a single auth method in most cases and may even wish to use diff auth methods to create separate accounts. So it may not be worth the trouble unless you have an app that depends on sharing data between providers.

    0 讨论(0)
提交回复
热议问题