Firebase远程配置REST授权错误

2024-06-23

我正在使用一个蟒蛇脚本 https://github.com/firebase/quickstart-python/tree/master/config以 json 文件形式获取我的 firebase 远程配置数据。 我的问题是,在我设置之后服务帐户 https://firebase.google.com/docs/remote-config/use-config-rest#before_you_begin_enable_the_rest_api,我仍然收到授权错误。我的服务帐户的角色已设置为“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 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 https://console.firebase.google.com/project/your_project_name/settings/serviceaccounts/adminsdk

希望这对某人有帮助。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Firebase远程配置REST授权错误 的相关文章

随机推荐