@@ -418,9 +418,6 @@ static UserAuthorizer getUserAuthorizer(
418418 userAuthorizerBuilder .setTokenServerUri (
419419 new URI (overrideProperties .get (BigQueryJdbcUrlUtility .OAUTH2_TOKEN_URI_PROPERTY_NAME )));
420420 }
421- List <String > scopes = new java .util .ArrayList <>(DEFAULT_BIGQUERY_SCOPES );
422-
423- userAuthorizerBuilder .setScopes (scopes );
424421
425422 return userAuthorizerBuilder .build ();
426423 }
@@ -550,14 +547,11 @@ static UserCredentials getPreGeneratedRefreshTokenCredentials(
550547 overrideProperties .get (BigQueryJdbcUrlUtility .UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME ));
551548 }
552549
553- UserCredentials userCredentials = userCredentialsBuilder .build ();
554-
555550 LOG .info ("Connection established. Auth Method: Pre-generated Refresh Token." );
556- return userCredentials ;
551+ return userCredentialsBuilder . build () ;
557552 }
558553
559- private static GoogleCredentials getApplicationDefaultCredentials (
560- Map <String , String > authProperties , String callerClassName ) {
554+ private static GoogleCredentials getApplicationDefaultCredentials (String callerClassName ) {
561555 LOG .finest ("++enter++\t " + callerClassName );
562556 try {
563557 GoogleCredentials credentials = GoogleCredentials .getApplicationDefault ();
@@ -620,18 +614,15 @@ private static GoogleCredentials getExternalAccountAuthCredentials(
620614
621615 GoogleCredentials credentials ;
622616 if (credentialsPath != null ) {
623- credentials =
624- ExternalAccountCredentials . fromStream ( Files .newInputStream (Paths .get (credentialsPath )));
617+ return ExternalAccountCredentials . fromStream (
618+ Files .newInputStream (Paths .get (credentialsPath )));
625619 } else if (jsonObject != null ) {
626- credentials =
627- ExternalAccountCredentials .fromStream (
628- new ByteArrayInputStream (jsonObject .toString ().getBytes ()));
620+ return ExternalAccountCredentials .fromStream (
621+ new ByteArrayInputStream (jsonObject .toString ().getBytes ()));
629622 } else {
630623 throw new IllegalArgumentException (
631624 "Insufficient info provided for external authentication" );
632625 }
633-
634- return credentials ;
635626 } catch (IOException e ) {
636627 throw new BigQueryJdbcRuntimeException (e );
637628 }
0 commit comments