Configuring OAuth 2.0 for Google services (Youtube, BigQuery, etc.)

Hi everyone :wave: wanted to share information on connecting to Google services through OAuth 2.0, which can be a bit tricky.

I’ve copied a solution for setting up Google BigQuery. If you are connecting a different Google service, it likely uses the same OAuth 2.0 method. Please ignore parts of this that do not apply to your service, or replace them with the relevant Google Cloud information.

Getting set up

Go to your project dashboard at https://console.cloud.google.com/home/dashboard and click “Explore and enable APIs” under “Getting Started.”

  • Click on the BigQuery (or other service) API link, or click “+ Enable APIs and Services”
  • Search for and enable the API you wish to connect to
  • Click on Credentials
  • Click “+ Create Credentials” and choose “OAuth client ID”
  • Set up the name for your credentials by clicking “Create Consent Screen” and enter https://parabola.io/api/steps/generic_api/callback as a verified callback URL

Now, you should have a client_id and client_secret.

In Parabola, open the Pull from an API step and select the OAuth 2.0 option from the Authorization tab. Click the blue Authorize button.

You will now see a form with three parts:

Part 1

Enter this URL: https://accounts.google.com/o/oauth2/v2/auth?client_id=YOUR-CLIENT-ID&redirect_uri=https%3A%2F%2Fparabola.io%2Fapi%2Fsteps%2Fgeneric_api%2Fcallback&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fbigquery&access_type=offline&response_type=code&prompt=consent

Replace the value that follows “client_id” with your actual client_id, and replace “bigquery” with the name of the service you are trying to connect to.

Part 2

Enter this URL: https://www.googleapis.com/oauth2/v4/token

For the Access Token Request Body, enter these 4 pairs:

Replace the values for the last two with your actual client_id and client_secret.

Part 3

Use the same URL as part 2, and in the body, send the following:

  • grant_type : refresh_token
  • client_id : your client id
  • client_secret : your client secret

Replace the values for the last two with your actual client_id and client_secret.

Final Steps

  • Click the blue Authorize button at the bottom of the form, and a pop up window should appear asking if you would like to connect Parabola to your Google account
  • Click on the account that you want to connect (if it prompts you), and it will show you a warning that “This app isn’t verified”
  • Click the “Continue” button, and then allow Parabola access to the service
  • Click on “Allow” to create authorize the connection
  • It may ask you to verify which project you’d like to connect - choose the project and confirm

After all of that, you should be returned to Parabola, and can now access your Google’s APIs. Feel free to comment specific questions below, and we are happy to help you configure these connections!

Note: We know this documentation is not perfect, and we are continually updating this information :slight_smile: any and all suggestions are welcome!

1 Like

Hi thanks for this, can i use this to write into Google Users, Groups. etc …
This is excellent news if it works. So good
It can help us create Google classes for teachers, add students, OMG unbelievable, automate teachers & student email distribution groups.

I was under the impression that, since Client Credentials Oauth2.0 did not work this wouldn’t work as well

1 Like

Hi @ANTONY_RAPPAI,

Have you tried to authenticate to Google’s APIs using the method above?

Taking a look at Google’s documentation, nearly all of the authentication scenarios list the flow type of authorization code.

Give it a shot, and let us know how it pans out!

Hi, i just tested this, and this works, i had to look up the appropriate scope from here OAuth 2.0 Playground

I wouldn’t have been able to figure out the Google OAUTH without this post, so thank you

1 Like

Our pleasure @ANTONY_RAPPAI! Glad to hear you were able to get this set up.

Sounds like some really cool new use cases were unlocked!

Hi, quick question, i noticed i had to edit the API Creds and authorize with my Google Account every now and then, i wonder if this could be worked around or am i doing something wrong here.

Thanks
Anto

Hey @ANTONY_RAPPAI,

Did you receive any error codes when pulling in your data? Double-check Part 3 of your setup to ensure your grant_type is set up correctly

My guess is that your access token is expiring but your refresh token is not generating a new token to sustain your authorization.

If it’s easiest, feel free to send us an email at help@parabola.io and we can look at your settings together.