【问题标题】:How to authenticate with firebase rules (RESTful)如何使用 Firebase 规则进行身份验证(RESTful)
【发布时间】:2021-11-29 17:08:03
【问题描述】:

当我向 firebase 发出请求时,我不确定将身份验证 uid 令牌传递到何处。

我试过了:

[myfirebaseurl]/path/1234.json?auth=[我设置的uid]。

除了将 UID 放入标头、内容和授权中。在将其放入我的应用程序之前,我目前正在对 reqbin 进行测试。

基本上,它是 url 参数、标题,还是我应该在哪里传递我在 firebase 规则选项卡中设置的 UID?

感谢您的帮助!

【问题讨论】:

    标签: python firebase rest restful-authentication


    【解决方案1】:

    您似乎正在尝试authenticate with an ID token。 ID 令牌与 UID 相同,如果您只需要他们的 UID,那么访问其他人的帐户就太容易了。

    您需要retrieve an ID token 并在您当前使用 UID 的地方使用它。

    【讨论】:

    • 我正在使用我在规则中设置的 UID。这是我的规则
    • { "rules": { "Whitelists": { ".read": "auth.uid == 'secret'", ".write": "auth.uid == 'secret'" , "$uid" : { ".read": "$uid === auth.uid || auth.uid == 'secret'", ".write": "auth.uid == Secret'" } } } }
    • 我用secret替换了服务器UID。
    • 这个资源让我很困惑。我正在制作一个 python 应用程序。我怎样才能获得 ID 令牌?
    • 我发表了一篇关于另一个澄清的深入帖子。不过,如果你不能或不想再提供帮助也没关系。 stackoverflow.com/questions/69527867/…
    猜你喜欢
    • 2013-03-25
    • 2011-11-12
    • 2016-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    • 2019-08-14
    • 2021-03-01
    相关资源
    最近更新 更多