Firebase Functions 2nd Gen: The request was not authorized to invoke this service. #12305
Unanswered
madhavgharmalkar
asked this question in
Q&A
Replies: 2 comments 2 replies
|
@madhavgharmalkar 👋🏽 I came here trying to find a solution myself. I was getting the same error when deploying 2nd gen Cloud function (written in Python). I managed to resolve it by updating the IAM policy. I had to update the members from service account to allUsers (since I built a public API) and assigning the roles/run.invoker. Verify the policy using: `gcloud run services get-iam-policy projects//locations//services/
Try assigning this role to the user/service account according to your function requirements. I hope that helps 🙌🏽 |
0 replies
|
What worked for me was deleting my functions from the google cloud console and redeploy them |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Hey! 👋🏾
I'm running into an issue using Swift, and 2nd Gen firebase functions (Node / Typescript). I've successfully tested my functions using the local emulator, and have successfully deployed them to firebase. However when I try to invoke the function, I run into the following error:
The request was not authorized to invoke this service. Read more at https://cloud.google.com/run/docs/securing/authenticating Additional troubleshooting documentation can be found at: https://cloud.google.com/run/docs/troubleshooting#401After doing some searching on google, I found this StackOverflow issue which recommends adding the
Cloud Functions Invokerpermission to the service account. I tried that and it didn't work. Just to make sure, I added theCloud Functions Invokerrole to every account in my GCP IAM and I still haven't had any luck.Any suggestions would be awesome!
All reactions