firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

Call Firebase Functions from Editor with Service Account

Open rusitschka opened this issue 7 years ago • 2 comments

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?

rusitschka avatar Oct 17 '18 14:10 rusitschka

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

chkuang-g avatar Oct 19 '18 19:10 chkuang-g

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.

StephenHodgson avatar May 08 '22 17:05 StephenHodgson