0
votes

What I have:

A google cloud function and an HTTP trigger like : https://us-central1-{project_name}.cloudfunctions.net/{function_name}.

Currently, I have set unauthenticated access by selecting allUsers in the permissions of the cloud function.

A web application that needs to call this cloud function.

What I want:

Implement authentication for this function.

Any step by step guide to implement Oauth 2 authentication for a google cloud function (without the need to add any code in the cloud function end) will be highly appreciated.

1
What is missing in this page? What's the main blocker for you?guillaume blaquiere
Have you checked the documentation provided by Guillaume? It does provided all the steps you need to do to implement auth in Cloud Functions. If yes, what have you tried already?Rafael Lemos
Thanks for responding. I am following this link. I now have a client id and secret. Now how can I call this cloud function from my web application? The web application should have only the client ID correct? So how can I call the function with the client ID?katZwat
The web application is just a simple index.php file from which I want to curl and get the response from the cloud functionkatZwat

1 Answers

1
votes

It seems I was doing something wrong and not thinking about this clearly. I started from scratch and followed the link https://cloud.google.com/functions/docs/securing/authenticating and was able to generate the bearer token.

Thanks for the help in the comments section.