【问题标题】:Getting user info from request to Cloud Function in Firebase从请求中获取用户信息到 Firebase 中的 Cloud Function
【发布时间】:2019-02-25 22:15:49
【问题描述】:

我希望能够获取在 Firebase 中调用的云函数的用户信息。我有这样的东西,在用户登录应用程序后被调用:

exports.myFunction = functions.https.onRequest((req, res) => { ... }

我需要获取发出请求的登录用户的 uid。请问有什么建议或cmets吗?

【问题讨论】:

    标签: firebase firebase-authentication google-cloud-functions


    【解决方案1】:

    有关发出请求的用户的信息不会与 HTTPS 函数调用一起自动传递。

    您可以pass the ID token along yourself and decode/verify it in your function,也可以use a callable HTTPS function,它会自动传递用户信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-18
      • 1970-01-01
      • 1970-01-01
      • 2021-04-26
      • 2019-01-27
      • 2016-01-28
      • 2021-01-25
      相关资源
      最近更新 更多