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

config credentials failing in emulator #445

Closed
kiwipxl opened this issue Sep 4, 2017 · 6 comments
Closed

config credentials failing in emulator #445

kiwipxl opened this issue Sep 4, 2017 · 6 comments
Assignees

Comments

@kiwipxl
Copy link

kiwipxl commented Sep 4, 2017

Version info

3.9.2

Steps to reproduce

  • Setup a firebase functions project and initialize admin through firebase config.
  • Run local emulator (through serve)
  • Try use any command in auth, such as getUserByEmail (database works perfectly however)

admin.initializeApp(functions.config().firebase);
admin.auth().getUserByEmail("fake@gmail.com")

Expected behavior

Works in emulator.
Works when deployed.

Actual behavior

Fails in emulator (Error: No Firebase project was found for the provided credential.)
Works when deployed.

https://gist.github.com/kiwipxl/791af036794a24ab8cdceffc8a626836

@laurenzlong laurenzlong self-assigned this Sep 5, 2017
@laurenzlong
Copy link
Contributor

Thanks for the report! This is a bug in the way that the local emulator deals with default credentials. This will unfortunately take some time to fix, in the meanwhile, you can work around this by initializing firebase-admin with a service account (https://firebase.google.com/docs/admin/setup#initialize_the_sdk)

@jsdbroughton
Copy link

This workaround to the admin.initializeApp(functions.config().firebase); issue is helpful - thankyou.

@GioLogist
Copy link

Is there also a bug with how the emulator deals with config?

Currently, running
firebase functions:config:set someservice.key="THE API KEY" someservice.id="THE CLIENT ID"

As per these instructions works as expected once deployed and in production logs. However, someservice is non-existent in the config, when serving locally.

@laurenzlong
Copy link
Contributor

We do not yet support emulation of config values, see https://firebase.google.com/docs/functions/local-emulator#install_and_configure_the_cloud_functions_shell for the workaround

@thechenky
Copy link
Contributor

Closing for inactivity.

@IchordeDionysos
Copy link
Contributor

@laurenzlong is this fixed already?

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

No branches or pull requests

6 participants