firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
228 stars 37 forks source link

Call Firebase Functions from Editor with Service Account #276

Open rusitschka opened 6 years ago

rusitschka commented 6 years ago

I'm looking for a way to call a Firebase Function with the credentials of a Service Account running in Unity Editor. Database access works fine with the Service Account but when calling a Firebase Function, context.auth is empty on the server side.

Is it possible to provide a valid session for a Service Account which has context.auth set?

chkuang-g commented 6 years ago

Hi @rusitschka Unfortunately Service Account does not work for Function client SDK and we do not have concrete plan about the support for this. On the other hand, you should be able to use a User Account and check the user id in your Function.

Hope this helps! Shawn

StephenHodgson commented 2 years ago

You could add a check for editor runtime, the use the correct auth headers depending on this flag. But you'll need to handle the credentials yourself.