Authenticating when invoking a Google Cloud Function

Hey everyone,

I’m trying to invoke a Google Cloud Function via HTTP POST. This function requires authentication, providing a bearer token. For testing, we would generate a token manually and paste it as a header in our HTTP POST module in Make, and it worked.

The problem is these tokens expire after 1 hour. I’m aware that you can generate or refresh tokens programmatically in Python, however, we cannot run any code in Make right now (I think some services allow this, but we don’t have them).

Also, we don’t want to allow public access to the function.

I’d like to know if there is any way I can generate/refresh the necessary token in Make, or if I can invoke the function with a different authentication method that is compatible.

Welcome to the Make community!

How to create an OAuth app in GCP: ← FOLLOW THIS

1a. Enable the relevant API

Find the relevant API here: Google Cloud console
Go to API page, end click “Enable”

1b. Add the relevant scopes

Direct Link:

2. Insert all the known Google Redirect URIs for your app

Direct Link:

Here are some known redirect URIs you need for your Google Cloud Console OAuth app. If you set these up, you can reuse the same GCP app for other Google apps and modules on Make.

Once you’ve set these up, you can use/reuse the same Make connection for all the supported Google apps & modules on Make - you’ll only have to enable the APIs for your custom app.

3. Publish your GCP OAuth2 app

Direct Link:

You might need to set your OAuth application to “Production”, otherwise the credentials expire very frequently.

1. To do this, go to menu item “OAuth consent screen”

or click here

2. Then click the button below if the Publishing status is not “In production”

4. Set up connection (HTTP OAuth, or respective Google App)

A. HTTP OAuth2

You need a “Authorize parameters” key of redirect_uri with the above Make OAuth2 callback URL.

You can find the Client ID and Client Secret in the OAuth2 app you created in GCP, on the right-hand side of where you inserted the 8 callback URLs in step 2:

B. Google App

Insert the GCP app client ID and secret here BEFORE clicking “Sign in”
Gmail example:

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!