I'm building an app with React as front end and hosted on firebase hosting.
I'd like to build an api server for the front, and considering Fastapi + Docker deploy to Cloud Run.
https://firebase.google.com/docs/hosting/cloud-run#direct_requests_to_container https://cloud.google.com/run/docs/integrate/firebase-hosting
I found these 2 tutorials about how to connect firebase hosting to cloud run, but I'd like the Cloud Run to only accept accesses from firebase hosting app.
Is there any way to achieve this?
===== update ============================================
I read from https://cloud.google.com/run/pricing that
Requests are only billed when they reach the container after successfully being authenticated, requests denied by IAM policy are not billed.
And under that link in the quote, there's a document about how to Authenticating end users
https://cloud.google.com/run/docs/authenticating/end-users
and a detailed tutorial https://cloud.google.com/run/docs/tutorials/identity-platform
Using Firebase Authentication is similar to using Identity Platform.
I'm a little confused about the authenticating
.
Does it mean I can:
firebase authentication
Is that right?
I have the same issue and I used firebase APP CHECK.
App Check helps protect your API resources from abuse by preventing unauthorized clients from accessing your backend resources. It works with both Google services (including Firebase and Google Cloud services) and your own APIs to keep your resources safe.
Steps: