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

Auth does not work with ADC #2169

Closed
firemuzzy opened this issue May 1, 2023 · 3 comments
Closed

Auth does not work with ADC #2169

firemuzzy opened this issue May 1, 2023 · 3 comments

Comments

@firemuzzy
Copy link

  • Operating System version: Mac OS 12.5
  • Firebase SDK version: 11.7.0
  • Firebase Product: auth
  • Node.js version: 18.16.0
  • NPM version: 9.5.1

Describe the problem

Firebase auth with application default permission throws PERMISSION_DENIED. I have tried running gcloud auth application-default login --impersonate-service-account=... and that still errors with

The error:

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. Raw server response: "{"error":{"code":403,"message":"Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the identitytoolkit.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://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.","errors":[{"message":"Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell which are not supported by the identitytoolkit.googleapis.com. We recommend configuring the billing/quota_project setting in gcloud or using a service account through the auth/impersonate_service_account setting. For more information about service accounts and how to use them in your application, see https://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.","domain":"usageLimits","reason":"accessNotConfigured","extendedHelp":"https://console.developers.google.com"}],"status":"PERMISSION_DENIED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"SERVICE_DISABLED","domain":"googleapis.com","metadata":{"service":"identitytoolkit.googleapis.com","consumer":"projects/764086051850"}}]}}"

Steps to reproduce:

  • auth with application default gcloud auth application-default login
  • initialize firebase admin
  • call getUser(...) on auth

here is a full repo to reproduce the issues

https://github.com/firemuzzy/adc-firebase-auth-error

@lahirumaramba
Copy link
Member

Hi @firemuzzy, thank you for the repro!
We are currently working on migrating credentials to google-auth-library-nodejs, which should fix the issue you are facing. Please follow #1377 for updates.

@lox
Copy link

lox commented Aug 31, 2023

Could this possibly be re-opened? Whilst #1377 might fix it, this is still an open issue and shouldn't be closed IMO.

@is2ei
Copy link

is2ei commented Oct 17, 2023

It seems #2106 is the same issue.

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

5 participants