Reputation: 11
I have three projects under my organization on GCP (dev, staging, prod). The IAM settings are shared/set on the organizational level.
On each project I have made a Cloud Run app with the GCP example container "hello". Keep in mind that all of these setups are identical.
Worth mentioning: I have one domain, and have made three subdomains under it. dev.domain.com etc... I set the DNS settings accordingly to the load balancer.
The result is that one of these projects works with signing in and accessing the app. The other ones are forbidden with the detailed response: "The request was not authenticated. Either allow unauthenticated invocations or set the proper Authorization header"
Yet another "check": If the Run app authentication settings is set to "allow unauthenticated invocations" all of them work. With "Require authentication" (IAP used) only one works.
So the question is: What can interfere/cause so that only one project can authenticate to the service while the other ones cant. Could it have something with the domain to do?
I have tried deleting one of the projects (that was not working) and remaking it again from scratch with the same results.
I bought a new domain and tried to connect that to one of the load balancers instead. But that didn't make a difference.
Upvotes: 1
Views: 435
Reputation: 31
as I remember, the Google cloud documentation contains a recommendation to disable authentication on Cloud Run if traffic is passed through IAP; you can protect your instance by setting the --ingress parameter to "internal-and-cloud-load-balancing"
you can use Google Groups or an end-user account in IAP as an identifier for access to your instance
IAP & Identity Platform attach the custom header to a passed request so you can get a user identifier from it; if you use Python, please find a solution for this here.
Upvotes: 0