@@ -230,27 +230,22 @@ static Map<String, String> parseOAuthProperties(DataSource ds, String callerClas
230230 break ;
231231 }
232232
233- if (authType == AuthType .GOOGLE_SERVICE_ACCOUNT
234- || authType == AuthType .GOOGLE_USER_ACCOUNT
235- || authType == AuthType .PRE_GENERATED_TOKEN
236- || authType == AuthType .APPLICATION_DEFAULT_CREDENTIALS ) {
237- oauthProperties .put (
238- BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME ,
239- ds .getOAuthSAImpersonationEmail ());
240- oauthProperties .put (
241- BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME ,
242- ds .getOAuthSAImpersonationChain ());
243- oauthProperties .put (
244- BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME ,
245- ds .getOAuthSAImpersonationScopes () != null
246- ? ds .getOAuthSAImpersonationScopes ()
247- : BIGQUERY_SCOPE );
248- oauthProperties .put (
249- BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME ,
250- ds .getOAuthSAImpersonationTokenLifetime () != null
251- ? ds .getOAuthSAImpersonationTokenLifetime ()
252- : BigQueryJdbcUrlUtility .DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE );
253- }
233+ oauthProperties .put (
234+ BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME ,
235+ ds .getOAuthSAImpersonationEmail ());
236+ oauthProperties .put (
237+ BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME ,
238+ ds .getOAuthSAImpersonationChain ());
239+ oauthProperties .put (
240+ BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME ,
241+ ds .getOAuthSAImpersonationScopes () != null
242+ ? ds .getOAuthSAImpersonationScopes ()
243+ : BIGQUERY_SCOPE );
244+ oauthProperties .put (
245+ BigQueryJdbcUrlUtility .OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME ,
246+ ds .getOAuthSAImpersonationTokenLifetime () != null
247+ ? ds .getOAuthSAImpersonationTokenLifetime ()
248+ : BigQueryJdbcUrlUtility .DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE );
254249 return oauthProperties ;
255250 }
256251
@@ -288,7 +283,6 @@ static GoogleCredentials getCredentials(
288283 credentials = getApplicationDefaultCredentials (callerClassName );
289284 break ;
290285 case EXTERNAL_ACCOUNT_AUTH :
291- // This auth method doesn't support service account impersonation
292286 credentials = getExternalAccountAuthCredentials (authProperties , callerClassName );
293287 break ;
294288 default :
0 commit comments