Google Identity Rest API 失败

问题描述 投票:0回答:1

我正在尝试访问 Google Identity REST API 以进行 Firebase 身份验证。使用 Firebase Admin SDK 登录后,我使用:

const projectID = app.options.projectId;

const token = await app.options.credential?.getAccessToken();

if (!token) {
    throw 'No token!';
}

const url = `https://identitytoolkit.googleapis.com/v1/projects/${projectID}/accounts:query?alt=json`;
const options = {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token.access_token}`
    },
    body: JSON.stringify({
        "returnUserInfo": false,
        "expression": []
    })
};

return await fetch(url, options).then(response => response.json());

但我收到此错误:

{
  "error": {
    "code": 403,
    "message": "VPCSC_CHECK_FAILED : Permission denied: Consumer 'project_number:{my-project-number}' has been suspended.",
    "errors": [
      {
        "message": "VPCSC_CHECK_FAILED : Permission denied: Consumer 'project_number:{my-project-number}' has been suspended.",
        "domain": "global",
        "reason": "forbidden"
      }
    ],
    "status": "PERMISSION_DENIED"
  }
}

据我所知,我的项目尚未暂停。这是权限问题吗?如果是这样我该如何解决这个问题?我没有使用任何限制或边界等。只是一个常规的 Firebase 帐户,其中 Firebase 管理员按预期工作。我需要特定的 IAM 设置吗?

google-cloud-platform firebase-authentication google-identity
1个回答
0
投票

以下是您可以交叉检查并验证的几个原因:

  • 帐户被暂停的原因之一是,如果您是

    使用免费套餐帐户,积分可能会用完,而您

    需要付费才能重新启用账户和项目。

  • 2023 年 3 月 27 日或之前在项目中的“Firebase 身份验证旧版”上启用的日志记录无法为该项目启用 Google Cloud Identity Platform。因此,您不应使用 Google Cloud Identity Billing,而需要使用 Firebase Auth Billing。您能否交叉检查并确认 Firebase Auth Billing 是否已启用。

  • 根据此权限文档,您可以在 IAM 角色中启用 firebase.billingPlans.get 和 firebase.billingPlans.update 吗?

© www.soinside.com 2019 - 2024. All rights reserved.