简体   繁体   中英

403 "Error: Forbidden" when opening the URL of my Cloud Run service

I built my container image and then deployed to Cloud Run using the Cloud Console. However, when I open the endpoint URL of my service, I get a 403 "Error: Forbidden" page

If you receive a 403 "Error: Forbidden" error message when accessing your Cloud Run service, it means that your client is not authorized to invoke this service. You can address this by taking one of the following actions:

Try this solution.

Go to Cloud Run then click on your service (In this example, "hello-world") :

在此处输入图像描述

Then, go to "TRIGGERS" and look at "Authentication" :

在此处输入图像描述

Your "Authentication" will be "Require authentication" :

在此处输入图像描述

So change it to "Allow unauthenticated invocations" then click on "SAVE" :

在此处输入图像描述

Finally, you will be able to open your URL properly.

In addition, you can choose "Allow unauthenticated invocations" for "Authentication" when you create a service on Cloud Run :

在此处输入图像描述

I have used IAP to resolve this issue. If there is a use case where only authenticated users must be able to access the application then use IAP

Accessing Authenticated Cloud Run applications using IAP

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM