403 error with Google Search Console via HTTP oAuth 2.0 request

Hi All,

I’m trying to use an HTTP Make an oAuth 2.0 request to retrieve Google Search console search analytics data.

I set up a connection following this guide, and I thought it was set up correctly, however, when I try to run the module. I get a 403 error saying that “User does not have sufficient permission for site”.

Any thoughts about what I might be doing wrong?

Happy to provide any screenshots that would be helpful. Thanks in advance.

-max

It is likely you are missing the required scopes for using Search Console, or your site is not set-up (authorised) in search console.

Have you followed all these steps yet?

1. Enable the API

Direct Link: Google Cloud console

Screenshot_2024-01-23_090101

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

Direct Link: https://console.cloud.google.com/apis/credentials

How to create an OAuth app in GCP: https://www.make.com/en/help/tutorials/calling-google-apis-via-the--http-make-a-oauth-2-0-request--module ← FOLLOW THIS

Here are all the 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.

https://www.make.com/oauth/cb/oauth2
https://www.make.com/oauth/cb/google-custom
https://www.make.com/oauth/cb/google-restricted
https://www.make.com/oauth/cb/google-cloud-speech
https://www.integromat.com/oauth/cb/oauth2
https://www.integromat.com/oauth/cb/google-custom
https://www.integromat.com/oauth/cb/google-restricted
https://www.integromat.com/oauth/cb/google-cloud-speech

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 respective APIs for your custom app in Google Cloud.

According to the Make OAuth2 documentation, the main one you need to use for HTTP OAuth connection is

https://www.integromat.com/oauth/cb/oauth2

3. Publish your GCP OAuth2 app

Direct Link: https://console.cloud.google.com/apis/credentials/consent

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 https://console.cloud.google.com/apis/credentials/consent

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

4. Configure the HTTP OAuth2 module

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:
Screenshot_2024-01-23_100145

3 Likes

Thanks so much for the detailed response. I’ve updated my app and added a new connetion in Make, but I’m still struggling to successfully submit the request. Now I’m getting a slightly different 403 error that says, “Request had insufficient authentication scopes”.

Initially, in my connection I included just the scope that you showed in your screenshot. I tried adding “https://www.googleapis.com/auth/webmasters”, which is listed on this page, but I’m still getting the same error. Any thoughts?

You’ll also likely need to add the scope to your GCP OAuth consent screen.

Please refer to Use Gmail Settings API with HTTP Make an OAuth 2.0 Request to get Signatures - #4 by samliew for instructions on how to add scopes to your GCP OAuth application consent screen.

2 Likes