Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
flagbug opened this issue Aug 4, 2022 · 3 comments
Closed

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

flagbug opened this issue Aug 4, 2022 · 3 comments

Comments

@flagbug
Copy link

flagbug commented Aug 4, 2022

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

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@foxrafa
Copy link
Contributor

foxrafa commented May 13, 2024

I submitted a fix here #2553

@lahirumaramba
Copy link
Member

#2553 is now included in the v12.2.0 release. This will act as a stopgap until we complete the credentials migration to google-auth library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants