Firebase远程配置REST授权错误

标签 firebase service-accounts firebase-remote-config

我正在使用python script以 json 文件形式获取我的 firebase 远程配置数据。 我的问题是,在我设置我的 service account 之后,我仍然收到授权错误。我的服务帐户的角色已设置为“Firebase 远程配置管理员”。即使作为“所有者”,我仍然收到授权错误。

{
  "error": {
    "code": 403,
    "message": "[AUTHORIZATION_ERROR]: User does not have the following permission: GET_TEMPLATE",
    "status": "PERMISSION_DENIED"
  }
}

关于检查授权的内容有什么建议吗?

最佳答案

基本上,Firebase 和 Google Storage 的服务帐户是不同的。

如果您尝试使用普通服务帐户获取模板,您将会失败

因此您必须按照以下步骤生成 Firebase 服务帐户

To generate a private key file for your service account:

In the Firebase console, open Settings > Service Accounts.

Click Generate New Private Key, then confirm by clicking Generate Key.

Securely store the JSON file containing the key.

更多详细信息可以在此链接中找到:https://firebase.google.com/docs/remote-config/automate-rc#get_an_access_token_to_authenticate_and_authorize_api_requests

简而言之,要设置 Firebase 服务帐户,请转到如下网址(替换 your_project_name)

https://console.firebase.google.com/project/your_project_name/settings/serviceaccounts/adminsdk

希望这对某人有帮助。

关于Firebase远程配置REST授权错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60162108/

相关文章:

amazon-web-services - 在亚马逊 Web 服务 aws 上构建类似 firebase/fanout.io 的服务

Firebase 仅部署 firebase.json

swift - 我需要帮助从 firebase 的快照中获取值

javascript - 我可以使用服务帐户对我网站上的用户进行身份验证,使他们能够查看我的 Google 云端硬盘中的选定文件吗?

android - 我可以将 A/B 测试的标题/名称或描述以及变体名称从 Firebase 获取到 Activity 中吗?

java - 按钮 setOnClickListener 函数调用问题

oauth-2.0 - 将 Google Cloud Endpoints 作为 iOS 应用程序进行身份验证(不是具有 Google 帐户凭据的用户)

kubernetes - serviceaccount 中不会自动生成可挂载的 key 和 token

swift - Firebase RemoteConfigSettings 不反射(reflect)minimumFetchInterval 更改

Android Firebase 远程配置初始提取不返回值