Using Pre-Generated Access and Refresh Tokens

You can configure the connector to authenticate the connection using access or refresh tokens that have already been generated from the Google Authorization Server. When using this method, you can authenticate your connection by providing an access token, or by providing a refresh token along with a client ID and client secret.

For information about obtaining access and refresh tokens, see "Using OAuth 2.0 to Access Google APIs" in the Google Identity Platform documentation: https://developers.google.com/identity/protocols/OAuth2.

Important:

Important:

When generating the tokens to access BigQuery, you must specify the https://www.googleapis.com/auth/bigquery scope. If you are working with federated tables, you should also specify the https://www.googleapis.com/auth/cloud-platform scope.

To configure authentication using an access or refresh token:

  1. Set the OAuthType property to 2.
  2. Set the ProjectID property to the name of your BigQuery project.
  3. Do one or both of the following:
    • Set OAuthAccessToken to your access token.
    • Or, set OAuthRefreshToken to your refresh token.
  4. If you are using a refresh token, set the OAuthClientId property to to your client ID and set the OAuthClientSecret property to your client secret.

For example, the following connection URL authenticates the connection using a refresh token:

jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;
OAuthType=2;ProjectId=MyBigQueryProject;
OAuthAccessToken=a25c7cfd36214f94a79d;OAuthRefreshToken=1jt9Pcyq8pr3lvu143pfl4r86;OAuthClientId=11b5516f132211e6;OAuthClientSecret=bCD+E1f2Gxhi3J4klmN;