I have micro services running on Cloud Run, and I want to leverage API Gateway.
Is it possible to use API Gateway to authenticate my users with a Cloud Function or a container in Cloud Run that consults the user's data from a database in Cloud SQL?
I have micro services running on Cloud Run, and I want to leverage API Gateway.
Is it possible to use API Gateway to authenticate my users with a Cloud Function or a container in Cloud Run that consults the user's data from a database in Cloud SQL?
TL;DR: you can't.
With API gateway, you have a limited number of built-in authentication method. In short, you have API Key (not really recommended because it's a long lived token) and OAuth2 (JWT token with FirebaseAuth/Cloud Identity Platform, Okta, Auth0, or a custom IdP).
In your case, if you want to use your own database for you own users, you need to plug, in front of your Cloud SQL database, a OAuth Identity Provider and implement the business logic that you want. And then, use API Gateway with a custom IDP.
But, the easiest is to use Firebase or Cloud Identity Platform (which is the implementation of FirebaseAuth in GCP). The users aren't in your database, but you can imagine synchronization (API Calls).