2

I have a new firebase function I deployed with firebase cli tool that is returning a unauthenticated api error when called from the application. I have updated the permissions on the function in gcloud to allUsers / invoke / allow unauthenticated, but this does not fix the issue. This is the extent of troubleshooting i have seen suggested on similar threads, has anyone been able to fix this issue at this point?

8
  • Tried signing out with firebase logout, upgrading to the latest cli version with npm i -g firebase-tools and then signing back in again with firebase login? Commented Dec 2, 2021 at 2:07
  • @samthecodingman just tried, did not work. Commented Dec 2, 2021 at 2:15
  • 1
    Where is the source of the error? In the Firebase CLI? On the Cloud Functions host? In the Cloud Function's source? Can you provide the code that you are using to call the function and the code that defines the function? Commented Dec 2, 2021 at 2:27
  • The error is reported from the frontend applications api cli. The function is a pub/sub function that runs fine scheduled, but when called from the application it fails unauthenticated. therefore the issue is not with the function Commented Dec 2, 2021 at 2:50
  • RE: Requesting code - While the problem may not be caused by a direct code issue, having code to test allows us to deploy our own copy of your function to investigate with. Commented Dec 2, 2021 at 4:21

2 Answers 2

1

The answer was pubsub functions cannot be called via https either with those permissions or through that api as done with regular https functions. I'm unsure if this is possible at all, I created a secondary duplicate function as a standard https function with the required permissions and it now works as expected.

Sign up to request clarification or add additional context in comments.

Comments

1

I often encounter the same problem. Try redeploying. Most of the time it works.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.