Skip to content

[FR] Setting quota project/x-goog-user-project #1854

@flagbug

Description

@flagbug

Is your feature request related to a problem? Please describe.

I have two projects in Google Cloud: project-a, which hosts Firebase stuff such as user authentication, and project-b, which contains a Node application that needs to have access to the Firebase API for e.g user administrative tasks in project-a. I've create a service account (let's call it service-b-sa in project-b and assigned service-b-sa the Firebase Admin role in project-a.

The problem now is that the requests that the Firebase Admin Node library sends fail with:

FirebaseAuthError: //cloud.google.com/docs/authentication/. 
If you are getting this error with curl or similar tools, you may need to specify 'X-Goog-User-Project' HTTP header for quota and billing purposes. 
For more information regarding 'X-Goog-User-Project' header, please check https://cloud.google.com/apis/docs/system-parameters.`

Other libraries, such as e.g the .NET library that we're using elsewhere for the same purposes let me set the quota/billing/user project directly, as an example for .NET, it would be GoogleCredential.GetApplicationDefault().CreateWithQuotaProject("project-a")

Describe the solution you'd like

A way to easily set the quota/billing/user project

Describe alternatives you've considered

I'm currently looking into intercepting the Node HTTP requests and attaching the header by force

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions