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.
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:
- Set the
OAuthTypeproperty to2. - Set the
ProjectIDproperty to the name of your BigQuery project. - Do one or both of the following:
- Set
OAuthAccessTokento your access token. - Or, set
OAuthRefreshTokento your refresh token.
- Set
- If you are using a refresh token, set the
OAuthClientIdproperty to to your client ID and set theOAuthClientSecretproperty 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;