firebase-unity-sdk
firebase-unity-sdk copied to clipboard
Call Firebase Functions from Editor with Service Account
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?
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
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.