I have been trying to deploy and run a simple Firebase Cloud Function. Every attempt fails due to what appears to be a fundamental issue with service account creation and authentication context in my project.
Symptoms:
- When calling the function, the
context.authobject is alwaysnullorundefined, even when the client sends a valid, verified ID token. The function logs showThe function must be called while authenticated. - During deployment, I am now receiving the error:
Error: Error generating the service identity for pubsub.googleapis.com.
We have already verified the following:
- The project is linked to an active billing account.
- All necessary APIs are enabled (Cloud Functions, Cloud Build, Run, Artifact Registry, IAM, etc.).
- We have tried manually adding IAM service accounts and toggling the Cloud Functions API off and on.
- We have removed all restrictions from the browser API key.
The project seems unable to correctly manage its own service identities and pass authentication context to its services.