【问题标题】:Why shouldnt you authenticate with the user UID when using firebase?为什么在使用 firebase 时不应该使用用户 UID 进行身份验证?
【发布时间】:2021-01-19 00:21:01
【问题描述】:

在用于管理用户的 firebase 文档中,它说:

// The user's ID, unique to the Firebase project. Do NOT use
// this value to authenticate with your backend server, if
// you have one. Use User.getToken() instead.

我目前正在使用用户的 UID 从我的后端获取某些数据。我不应该这样做吗?有人能解释一下到底是什么问题吗?

【问题讨论】:

  • 我认为这是说您不应该仅使用 UUID 登录用户。最好使用 getToken() 代替,因为它对每个请求都是唯一的并且不能重复。这仅适用于通过后端服务器进行身份验证时。
  • 这确实是@hudson 的原因。您可以将其写在答案中,以便我投票吗? ????。对于 wnba_youngboy:也可以在这里查看我的回答:stackoverflow.com/questions/37221760/… 和 Doug 在这里:stackoverflow.com/questions/53220681/…

标签: firebase firebase-authentication


【解决方案1】:

我认为这是说您不应该只使用 UUID 登录用户。使用getToken() 是更好的做法,因为它对每个请求都是唯一的并且不能重复。这仅适用于通过后端服务器进行身份验证时。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-08
    • 2016-04-08
    • 1970-01-01
    • 1970-01-01
    • 2021-07-24
    • 2011-10-27
    • 2022-01-13
    • 2020-04-28
    相关资源
    最近更新 更多