Can someone suggest if the below is a valid use case :
1. Create a Cloud Function with "Require authentication"
2. Create a API Gateway with API Key
3. The Cloud Function created in Point No 1 will be a end point in the gateway
The reason I am suggesting is, I do NOT want the Cloud Function with option "Allow unauthenticated invocations". This is because, even if I can use a Gateway (with API Key) to call the cloud function, if anyone knows the Trigger URL for the Cloud Function, they can call it directly by bypassing the gateway.
Hence, I do not want anyone to directly call the Cloud Function
I want everyone to use the Gateway (with API Key) to call the Cloud Function.
Any thoughts?
Solved! Go to Solution.
Hi @vbgcp,
Welcome back to Google Cloud Community!
Yes, this is a valid use case. By creating a Cloud Function with "Require authentication" and using an API Gateway with an API Key, you can restrict access to your Cloud Function and ensure that only authorized clients can invoke it.
Using an API Gateway with an API Key provides an extra layer of security, as it ensures that only clients with a valid API Key can access your Cloud Function. By using an API Gateway, you can also control access to your Cloud Function by setting up various authorization and authentication mechanisms.
Overall, this approach can help you ensure that your Cloud Function is secure and that only authorized clients can invoke it.
Thanks
Hi @vbgcp,
Welcome back to Google Cloud Community!
Yes, this is a valid use case. By creating a Cloud Function with "Require authentication" and using an API Gateway with an API Key, you can restrict access to your Cloud Function and ensure that only authorized clients can invoke it.
Using an API Gateway with an API Key provides an extra layer of security, as it ensures that only clients with a valid API Key can access your Cloud Function. By using an API Gateway, you can also control access to your Cloud Function by setting up various authorization and authentication mechanisms.
Overall, this approach can help you ensure that your Cloud Function is secure and that only authorized clients can invoke it.
Thanks
Thank you. Understood and Agreed.
Hello @christianpaula,
is there a way to set "Require authentication" in function code like with vpcConnector?
Thanks in Advance!