diff --git a/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index e60f0874c446..73bbb985799f 100644 --- a/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -139,6 +139,7 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { Long listenerPoolSize; String partnerToken; DatabaseMetaData databaseMetaData; + Boolean reqGoogleDriveScope; BigQueryConnection(String url) throws IOException { this(url, DataSource.fromUrl(url)); @@ -171,9 +172,15 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { this.overrideProperties.put( BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, this.universeDomain); } + + this.reqGoogleDriveScope = + BigQueryJdbcUrlUtility.convertIntToBoolean( + String.valueOf(ds.getRequestGoogleDriveScope()), + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME); + this.credentials = BigQueryJdbcOAuthUtility.getCredentials( - authProperties, overrideProperties, this.connectionClassName); + authProperties, overrideProperties, this.reqGoogleDriveScope, this.connectionClassName); String defaultDatasetString = ds.getDefaultDataset(); if (defaultDatasetString == null || defaultDatasetString.trim().isEmpty()) { this.defaultDataset = null; diff --git a/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java b/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java index f7be358dde18..eef61d393521 100644 --- a/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java +++ b/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java @@ -80,6 +80,13 @@ final class BigQueryJdbcOAuthUtility { + "Thank you for using JDBC Driver for Google BigQuery!\n" + "You may now close the window."; + static final String BIGQUERY_SCOPE = "https://www.googleapis.com/auth/bigquery"; + static final String DRIVE_READONLY_SCOPE = "https://www.googleapis.com/auth/drive.readonly"; + + static final List DEFAULT_BIGQUERY_SCOPES = Arrays.asList(BIGQUERY_SCOPE); + static final List BIGQUERY_WITH_DRIVE_SCOPES = + Arrays.asList(BIGQUERY_SCOPE, DRIVE_READONLY_SCOPE); + private static final int USER_AUTH_TIMEOUT_MS = 120000; private static final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(BigQueryJdbcOAuthUtility.class.getName()); @@ -117,6 +124,7 @@ static Map parseOAuthProperties(DataSource ds, String callerClas throw new IllegalArgumentException(OAUTH_TYPE_ERROR_MESSAGE); } oauthProperties.put(BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME, String.valueOf(authType)); + switch (authType) { case GOOGLE_SERVICE_ACCOUNT: // For using a Google Service Account (OAuth Type 0) @@ -144,11 +152,6 @@ static Map parseOAuthProperties(DataSource ds, String callerClas BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, ds.getOAuthClientId()); oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, ds.getOAuthClientSecret()); - int reqGoogleDriveScope = ds.getRequestGoogleDriveScope(); - oauthProperties.put( - BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, - String.valueOf(reqGoogleDriveScope)); - LOG.fine("RequestGoogleDriveScope parsed."); break; case PRE_GENERATED_TOKEN: String refreshToken = ds.getOAuthRefreshToken(); @@ -239,7 +242,7 @@ static Map parseOAuthProperties(DataSource ds, String callerClas BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME, ds.getOAuthSAImpersonationScopes() != null ? ds.getOAuthSAImpersonationScopes() - : BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE); + : BIGQUERY_SCOPE); oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME, ds.getOAuthSAImpersonationTokenLifetime() != null @@ -258,6 +261,7 @@ static Map parseOAuthProperties(DataSource ds, String callerClas static GoogleCredentials getCredentials( Map authProperties, Map overrideProperties, + Boolean reqGoogleDriveScopeBool, String callerClassName) { LOG.finest("++enter++\t" + callerClassName); @@ -280,15 +284,19 @@ static GoogleCredentials getCredentials( break; case APPLICATION_DEFAULT_CREDENTIALS: // This auth method doesn't support service account impersonation - return getApplicationDefaultCredentials(callerClassName); + + credentials = getApplicationDefaultCredentials(callerClassName); + break; case EXTERNAL_ACCOUNT_AUTH: // This auth method doesn't support service account impersonation - return getExternalAccountAuthCredentials(authProperties, callerClassName); + credentials = getExternalAccountAuthCredentials(authProperties, callerClassName); + break; default: throw new IllegalStateException(OAUTH_TYPE_ERROR_MESSAGE); } - return getServiceAccountImpersonatedCredentials(credentials, authProperties); + return getServiceAccountImpersonatedCredentials( + credentials, reqGoogleDriveScopeBool, authProperties); } private static boolean isFileExists(String filename) { @@ -388,29 +396,10 @@ static UserAuthorizer getUserAuthorizer( String callerClassName) throws URISyntaxException { LOG.finest("++enter++\t" + callerClassName); + List scopes = new ArrayList<>(); scopes.add("https://www.googleapis.com/auth/bigquery"); - // Add Google Drive scope conditionally - if (authProperties.containsKey( - BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)) { - try { - int driveScopeValue = - Integer.parseInt( - authProperties.get( - BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); - if (driveScopeValue == 1) { - scopes.add("https://www.googleapis.com/auth/drive.readonly"); - LOG.fine("Added Google Drive read-only scope. Caller: " + callerClassName); - } - } catch (NumberFormatException e) { - LOG.severe( - "Invalid value for RequestGoogleDriveScope, defaulting to not request Drive scope." - + " Caller: " - + callerClassName); - } - } - List responseTypes = new ArrayList<>(); responseTypes.add("code"); @@ -500,14 +489,18 @@ private static GoogleCredentials getPreGeneratedAccessTokenCredentials( builder.setUniverseDomain( overrideProperties.get(BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)); } + LOG.info("Connection established. Auth Method: Pre-generated Access Token."); - return builder - .setAccessToken( - AccessToken.newBuilder() - .setTokenValue( - authProperties.get(BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME)) - .build()) - .build(); + GoogleCredentials credentials = + builder + .setAccessToken( + AccessToken.newBuilder() + .setTokenValue( + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME)) + .build()) + .build(); + + return credentials; } static GoogleCredentials getPreGeneratedTokensCredentials( @@ -552,6 +545,7 @@ static UserCredentials getPreGeneratedRefreshTokenCredentials( userCredentialsBuilder.setUniverseDomain( overrideProperties.get(BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)); } + LOG.info("Connection established. Auth Method: Pre-generated Refresh Token."); return userCredentialsBuilder.build(); } @@ -571,6 +565,7 @@ private static GoogleCredentials getApplicationDefaultCredentials(String callerC LOG.info( "Connection established. Auth Method: Application Default Credentials, Principal: %s.", principal); + return credentials; } catch (IOException exception) { // TODO throw exception @@ -634,13 +629,19 @@ private static GoogleCredentials getExternalAccountAuthCredentials( // This function checks if connection string contains configuration for // credentials impersonation. If not, it returns regular credentials object. // If impersonated service account is provided, returns Credentials object - // accomodating this information. + // accommodating this information. private static GoogleCredentials getServiceAccountImpersonatedCredentials( - GoogleCredentials credentials, Map authProperties) { + GoogleCredentials credentials, + Boolean reqGoogleDriveScopeBool, + Map authProperties) { String impersonationEmail = authProperties.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME); if (impersonationEmail == null || impersonationEmail.isEmpty()) { + if (reqGoogleDriveScopeBool) { + credentials = credentials.createScoped(BIGQUERY_WITH_DRIVE_SCOPES); + LOG.fine("Added Google Drive read-only scope to GoogleCredentials."); + } return credentials; } @@ -653,10 +654,18 @@ private static GoogleCredentials getServiceAccountImpersonatedCredentials( // Scopes has a default value, so it should never be null List impersonationScopes = - Arrays.asList( - authProperties - .get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME) - .split(",")); + new java.util.ArrayList<>( + Arrays.asList( + authProperties + .get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME) + .split(","))); + + if (reqGoogleDriveScopeBool) { + if (!impersonationScopes.contains(DRIVE_READONLY_SCOPE)) { + impersonationScopes.add(DRIVE_READONLY_SCOPE); + LOG.fine("Added Google Drive read-only scope to impersonation scopes."); + } + } // Token lifetime has a default value, so it should never be null String impersonationLifetime = diff --git a/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index f03f8279ca6b..a1df06b08ef5 100644 --- a/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -70,8 +70,7 @@ protected boolean removeEldestEntry(Map.Entry> eldes static final String HTAPI_ACTIVATION_RATIO_PROPERTY_NAME = "HighThroughputActivationRatio"; static final String KMS_KEY_NAME_PROPERTY_NAME = "KMSKeyName"; static final String QUERY_PROPERTIES_NAME = "QueryProperties"; - static final int DEFAULT_HTAPI_ACTIVATION_RATIO_VALUE = - 2; // TODO: to adjust this value before private preview based on performance testing. + static final int DEFAULT_HTAPI_ACTIVATION_RATIO_VALUE = 2; static final String HTAPI_MIN_TABLE_SIZE_PROPERTY_NAME = "HighThroughputMinTableSize"; static final int DEFAULT_HTAPI_MIN_TABLE_SIZE_VALUE = 100; static final int DEFAULT_OAUTH_TYPE_VALUE = -1; @@ -86,8 +85,6 @@ protected boolean removeEldestEntry(Map.Entry> eldes static final String DEFAULT_OAUTH_SA_IMPERSONATION_CHAIN_VALUE = null; static final String OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME = "ServiceAccountImpersonationScopes"; - static final String DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE = - "https://www.googleapis.com/auth/bigquery"; static final String OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME = "ServiceAccountImpersonationTokenLifetime"; static final String DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE = "3600"; diff --git a/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java b/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java index 4430ba4cf315..dddc7c771100 100644 --- a/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java +++ b/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java @@ -413,4 +413,28 @@ public void testBigQueryJobCreationMode_default() throws Exception { bq.getOptions().getDefaultJobCreationMode(), JobCreationMode.JOB_CREATION_OPTIONAL); } } + + @Test + public void testWithDriveScopeTrue() throws Exception { + String url = BASE_URL + "RequestGoogleDriveScope=1;"; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + assertTrue(connection.reqGoogleDriveScope); + } + } + + @Test + public void testWithDriveScopeFalse() throws Exception { + String url = BASE_URL + "RequestGoogleDriveScope=0;"; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + assertFalse(connection.reqGoogleDriveScope); + } + } + + @Test + public void testWithDriveScopeDefault() throws Exception { + String url = BASE_URL; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + assertFalse(connection.reqGoogleDriveScope); + } + } } diff --git a/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java b/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java index ac2a7a8661e0..3630f86133dc 100644 --- a/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java +++ b/java-bigquery/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java @@ -18,7 +18,6 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -109,7 +108,7 @@ public void testInvalidTokenUriForAuthType0() { DataSource.fromUrl(connectionString).getOverrideProperties(); try { - BigQueryJdbcOAuthUtility.getCredentials(oauthProperties, overrideProperties, null); + BigQueryJdbcOAuthUtility.getCredentials(oauthProperties, overrideProperties, false, null); Assertions.fail(); } catch (BigQueryJdbcRuntimeException e) { assertThat(e.getMessage()).contains("java.net.URISyntaxException"); @@ -165,7 +164,7 @@ public void testGetCredentialsForPreGeneratedToken() { null); GoogleCredentials credentials = - BigQueryJdbcOAuthUtility.getCredentials(authProperties, Collections.EMPTY_MAP, null); + BigQueryJdbcOAuthUtility.getCredentials(authProperties, Collections.EMPTY_MAP, false, null); assertThat(credentials).isNotNull(); } @@ -185,7 +184,7 @@ public void testGetCredentialsForPreGeneratedTokenTPC() throws IOException { Map overrideProperties = new HashMap<>(stringStringMap); GoogleCredentials credentials = - BigQueryJdbcOAuthUtility.getCredentials(authProperties, overrideProperties, null); + BigQueryJdbcOAuthUtility.getCredentials(authProperties, overrideProperties, false, null); assertThat(credentials.getUniverseDomain()).isEqualTo("testDomain"); } @@ -200,7 +199,7 @@ public void testGetCredentialsForApplicationDefault() { null); GoogleCredentials credentials = - BigQueryJdbcOAuthUtility.getCredentials(authProperties, null, null); + BigQueryJdbcOAuthUtility.getCredentials(authProperties, null, false, null); assertThat(credentials).isNotNull(); } @@ -338,100 +337,6 @@ public void testParseBYOIDProps() { assertThat(result.get("BYOID_TokenUri")).isEqualTo("https://testuri.com/v1/token"); } - @Test - public void testParseOAuthProperties_UserAccount_RequestDriveScopeEnabled() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;" - + "RequestGoogleDriveScope=1;"; - Map properties = - BigQueryJdbcOAuthUtility.parseOAuthProperties( - DataSource.fromUrl(url), this.getClass().getName()); - assertEquals( - String.valueOf(BigQueryJdbcOAuthUtility.AuthType.GOOGLE_USER_ACCOUNT), - properties.get(BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME)); - assertEquals( - "redactedClientId", properties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME)); - assertEquals( - "redactedClientSecret", - properties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); - assertEquals( - "1", properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); - } - - @Test - public void testParseOAuthProperties_UserAccount_RequestDriveScopeDisabled() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;" - + "RequestGoogleDriveScope=0;"; - Map properties = - BigQueryJdbcOAuthUtility.parseOAuthProperties( - DataSource.fromUrl(url), this.getClass().getName()); - assertEquals( - "0", properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); - } - - @Test - public void testParseOAuthProperties_UserAccount_RequestDriveScopeDefault() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;"; - Map properties = - BigQueryJdbcOAuthUtility.parseOAuthProperties( - DataSource.fromUrl(url), this.getClass().getName()); - assertEquals( - String.valueOf(BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE), - properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); - } - - @Test - public void testGetUserAuthorizer_WithDriveScope() throws URISyntaxException { - Map authProperties = new HashMap<>(); - authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, "redactedClientId"); - authProperties.put( - BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, "redactedClientSecret"); - authProperties.put(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, "1"); - - UserAuthorizer authorizer = - BigQueryJdbcOAuthUtility.getUserAuthorizer( - authProperties, Collections.emptyMap(), 12345, this.getClass().getName()); - - assertTrue(authorizer.getScopes().contains("https://www.googleapis.com/auth/bigquery")); - assertTrue(authorizer.getScopes().contains("https://www.googleapis.com/auth/drive.readonly")); - assertEquals(2, authorizer.getScopes().size()); - } - - @Test - public void testGetUserAuthorizer_WithoutDriveScope() throws URISyntaxException { - Map authProperties = new HashMap<>(); - authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, "redactedClientId"); - authProperties.put( - BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, "redactedClientSecret"); - authProperties.put(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, "0"); - - UserAuthorizer authorizer = - BigQueryJdbcOAuthUtility.getUserAuthorizer( - authProperties, Collections.emptyMap(), 12345, this.getClass().getName()); - assertTrue(authorizer.getScopes().contains("https://www.googleapis.com/auth/bigquery")); - assertFalse(authorizer.getScopes().contains("https://www.googleapis.com/auth/drive.readonly")); - assertEquals(1, authorizer.getScopes().size()); - } - - @Test - public void testGetUserAuthorizer_InvalidDriveScopeValue() throws URISyntaxException { - Map authProperties = new HashMap<>(); - authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, "redactedClientId"); - authProperties.put( - BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, "redactedClientSecret"); - authProperties.put( - BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, "invalid_value"); - UserAuthorizer authorizer = - BigQueryJdbcOAuthUtility.getUserAuthorizer( - authProperties, Collections.emptyMap(), 12345, this.getClass().getName()); - assertFalse(authorizer.getScopes().contains("https://www.googleapis.com/auth/drive.readonly")); - } - @Test public void testParseUserImpersonationDefault() { String connectionUri = @@ -444,7 +349,7 @@ public void testParseUserImpersonationDefault() { "impersonated", result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME)); assertEquals( - BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE, + BigQueryJdbcOAuthUtility.BIGQUERY_SCOPE, result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME)); assertEquals( BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE, @@ -482,7 +387,7 @@ public void testGetServiceAccountImpersonatedCredentials() { .toString()), ""); GoogleCredentials credentials = - BigQueryJdbcOAuthUtility.getCredentials(authProperties, Collections.EMPTY_MAP, null); + BigQueryJdbcOAuthUtility.getCredentials(authProperties, Collections.EMPTY_MAP, false, null); assertThat(credentials).isInstanceOf(ImpersonatedCredentials.class); }