How to call firebase gen2 callable function from unity? - firebase

I'm implementing a server in Unity as a Firebase callable function.
I recently heard that gen2 was released and tried to change it.
But I couldn't call it in Unity.
The reason seems to be that gen2 doesn't have allUsers permission.
how can i call it?
P.s. Is it correct that the reason gen1's callable function has allUsers permission is to access other functions of Firebase?
Am I understanding correctly?

Related

Google Cloud Platform & Firebase - Cloud Scheduler Unauthenticated

Despite of setting permission allUsers with invoke cloud function role I'm not able to trigger scheduled cloud function due to error "unauthenticated".
Region is the same, tried to redeploy function few times.
What I can check for this issue?
This is fresh project.
This scheduled function was created using firebase tools
Fixed. Somehow it started to work after couple of hours without any changes with default roles.

How to Firebase cloud function deploy privately

When i use firebase deploy --only functions to deploy cloud functions for firebase, i discover, that this functions are deployed with the authentication flag allUsers.
How can i deploy firebase cloud function with private by default as mentioned here ?
There is no way to set this access control level of Cloud Functions through the Firebase CLI. It currently indeed always sets the access to allow all users. It sounds like a reasonable request to allow control of this though, so I'd file a feature request and possibly a PR on the repo.
For now: if you want to set this access level, you will have to do so in the Cloud console as explained in the Google Cloud documentation on controlling access on a function.

Unable to trigger firestore changes locally

I just started doing firebase and I need to do something when a new document is created but in functions and I setup cli and started locally but the function is not triggered.
while doing firebase init I chose firestore,functions,storage
after that did firebase login and firebase serve --only functions
and the server is up but whenever I add new document the function is not getting triggered?
You should be able to do that with firebase emulators:start. This starts emulators for Cloud Functions, Cloud Firestore, Realtime Database and Firebase Hosting. If that doesn't work, please share your code and I can have a look.
The docs may be useful too: https://firebase.google.com/docs/functions/local-emulator#run_the_emulator_suite

Firebase cloud function deployment webhook

I would like to get notified (webhook or something) when someone deploy a Firebase cloud function. Also I would like to know who is deploying that function or may be history of deployed cloud function.
Firebase provides history for web hosting but I'm not able to find anything similar for cloud function in Firebase console as well as GCP console.
Thanks in advance.
There is currently no webhook or history for function deployments. Please feel free to file a feature request.

firebase `signInWithEmailAndPassword` undefined

I'm a little new to firebase/cloud functions so forgive if I'm missing something simple.
I'm frustrated now because what I see on the documentation is not working. I read this part of the documentation: signInWithEmailAndPassword but when I use it in my nodejs code that I deploy to Firebase Cloud functions I get the error:
TypeError: auth.signInWithEmailAndPassword is not a function
Note that auth is actually auth(), I just decided to store the result of auth() in the variable auth, so don't let it confuse you.
I looked at the documentation and I don't see anything wrong I'm doing. This post Firebase Auth On The Server With Node.JS / Express and got this for it
If you initialize the Node.js SDK with an API key instead of a service account, you can use the normal client-side auth methods like authWithEmailAndPassword()
Currently I initialize it like this:
admin.initializeApp(functions.config().firebase)
What exactly am I expected to change so that the signInWithEmailAndPassword method becomes available on the object?
Do I really need to get a API key and initialize it like I'm initializing a frontend project when I'm using firebase-admin on a nodejs server?
Cloud Functions run on a trusted environment, and is using the Firebase Admin SDK to access Firebase services. There is no way (nor usually a need) to sign in as a user with email+password using the Admin SDK.
The Firebase Admin SDK runs with administrative privileges, giving it already has full access to the entire Firebase project that the code runs in.

Resources