OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

cant make firebase cloud function public

  • Thread starter Thread starter Sebastian Estrada
  • Start date Start date
S

Sebastian Estrada

Guest
i recently created a simple cloud function in firebase to get http responses from an endpoint. But every time i make a request, i'm getting a 401 with the message "The request was not authorized to invoke this service"

I was following this steps to make my function public:

  1. Go to Cloud run,
  2. Check the box next to your function,
  3. Click the button "PERMISSION",
  4. In the side bar, click on "ADD PRINCIPAL"
  5. Write "allUsers" and give them "cloud run invoker" permission.

But in the last step, i got this message

enter image description here

IAM policy update failed Invalid state 'projects/*********/locations/us-central1/functions/#####': The operation failed with precondition error. This is usually because the system is not in a state required for the operation's execution

Then i tried this:

  1. Go to the Google Cloud console
  2. Click the linked name of the function to which you want to grant access.
  3. Click the Powered By Cloud Run link in the top right corner of the Function details overview page.
  4. Click Trigger and select Allow unauthenticated invocations.
  5. Click Save.

and i got a similar message related to IAM/Policies

enter image description here

The 'Domain Restricted Sharing' organization policy (constraints/iam.allowedPolicyMemberDomains) is enforced. Only principals in allowed domains can be added as principals in the policy. Correct the principal emails and try again

I'm using the admin account to do all this, but for some reason I don't have any access to the IAM nor do I have any access to modify the organization's policies.

enter image description here
<p>i recently created a simple cloud function in firebase to get http responses from an endpoint.
But every time i make a request, i'm getting a 401 with the message "The request was not authorized to invoke this service"</p>
<p>I was following this steps to make my function public:</p>
<blockquote>
<ol>
<li>Go to Cloud run,</li>
<li>Check the box next to your function,</li>
<li>Click the button "PERMISSION",</li>
<li>In the side bar, click on "ADD PRINCIPAL"</li>
<li>Write "allUsers" and give them "cloud run invoker" permission.</li>
</ol>
</blockquote>
<p>But in the last step, i got this message</p>
<p><a href="https://i.sstatic.net/0k61jcUC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0k61jcUC.png" alt="enter image description here" /></a></p>
<p>IAM policy update failed
Invalid state 'projects/*********/locations/us-central1/functions/#####': The operation failed with precondition error. This is usually because the system is not in a state required for the operation's execution</p>
<p>Then i tried this:</p>
<blockquote>
<ol>
<li>Go to the Google Cloud console</li>
<li>Click the linked name of the function to which you want to grant access.</li>
<li>Click the Powered By Cloud Run link in the top right corner of the Function details overview page.</li>
<li>Click Trigger and select Allow unauthenticated invocations.</li>
<li>Click Save.</li>
</ol>
</blockquote>
<p>and i got a similar message related to IAM/Policies</p>
<p><a href="https://i.sstatic.net/VCUU5bvt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VCUU5bvt.png" alt="enter image description here" /></a></p>
<p>The 'Domain Restricted Sharing' organization policy (constraints/iam.allowedPolicyMemberDomains) is enforced. Only principals in allowed domains can be added as principals in the policy. Correct the principal emails and try again</p>
<p>I'm using the admin account to do all this, but for some reason I don't have any access to the IAM nor do I have any access to modify the organization's policies.</p>
<p><a href="https://i.sstatic.net/AJ3aoIz8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AJ3aoIz8.png" alt="enter image description here" /></a></p>
Continue reading...
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top