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
Error when serving Firebase functions on localhost in combination with Firebase Auth #595
Comments
Thanks for filing! This is a known issue that will take some time to address. In the meanwhile, I recommend initializing firebase-admin with a service account key. See https://firebase.google.com/docs/admin/setup#initialize_the_sdk |
Hello. I'm wondering how's the progress with this issue? |
We have documented how to do this: https://firebase.google.com/docs/functions/local-emulator#set_up_admin_credentials_optional |
Initializing with service account key as mentioned above still giving me the same error. |
@cjmling Please double check that the project that you downloaded the service account key from actually has auth enabled (you do this from the Firebase Console) |
@laurenzlong I've followed the instructions and made sure the envvar "GOOGLE_APPLICATION_CREDENTIALS " was declared but still getting the issue. Something I'm missing ? Thanks |
manage to get it working differently in cmd and powershell cmd set GOOGLE_APPLICATION_CREDENTIALS=src/serviceAccountKey.json firebase > getUsers.post('').json({data:null}); Powershell $Env:GOOGLE_APPLICATION_CREDENTIALS = "src/serviceAccountKey.json" firebase > getUsers.post('').json({data:null}); Notice that path is relative path to where you run the command. |
Closing this out since there is a documented way to set this up. Please file a new issue if you are experiencing any other problems. Thanks! |
@laurenzlong for some weird reason, my I am missing something? |
Are you on the latest version of the CLI? That issue sounds like the one
that was fixed here: #1340
…On Mon, Jun 10, 2019, 6:03 PM Mateo Tibaquirá ***@***.***> wrote:
@laurenzlong <https://github.com/laurenzlong> for some weird reason, my
GOOGLE_APPLICATION_CREDENTIALS env var is empty (checking it from my
Firebase Function, perhaps the absolute path looks ok from my ubuntu
console when I print it via echo $GOOGLE_APPLICATION_CREDENTIALS.
I am missing something?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#595?email_source=notifications&email_token=ACATB2S45QAYTRLCOUFH5XLPZ32XBA5CNFSM4ELEV6ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXLUGAQ#issuecomment-500646658>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACATB2WSXUTMOBGRZN2ZJG3PZ32XBANCNFSM4ELEV6ZA>
.
|
@samtstern yeah, I'm using I'm trying to run |
@matheo is it just this one variable or is your |
@samtstern I just printed another one, like
Note that I'm following these instructions https://firebase.google.com/docs/functions/local-emulator#set_up_admin_credentials_optional, and I've tried many things to initialize the
https://firebase.google.com/docs/admin/setup#initialize_the_sdk The firebase-CLI is reporting
but the response is the mentioned ENOTFOUND error:
|
@samtstern I found it! The
so the documentation and the solution pointed out by @laurenzlong previously, doesn't work with this feature. Is there a way to disable it from my config? |
Another solution: |
When serving a Firebase Functions on localhost, Firebase Auth does not work. When running the same code on "the cloud", it produces no errors.
We initialize the Firebase Admin SDK as follows:
admin.initializeApp(functions.config().firebase);
Version info
3.16.0
Steps to reproduce
Run
firebase serve --only functions
Create a functions that uses
admin.auth().createUser
Expected behavior
It creates a user in the Firebase Authentication module without errors.
Actual behavior
The text was updated successfully, but these errors were encountered: