File tree Expand file tree Collapse file tree
java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery
sdk-platform-java/java-core/google-cloud-core/src/main/java/com/google/cloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,6 +213,11 @@ public static HttpTransportOptions getDefaultHttpTransportOptions() {
213213 return HttpTransportOptions .newBuilder ().setReadTimeout (DEFAULT_READ_API_TIME_OUT ).build ();
214214 }
215215
216+ @ Override
217+ protected boolean useSelfSignedJwt () {
218+ return false ;
219+ }
220+
216221 @ Override
217222 protected Set <String > getScopes () {
218223 return SCOPES ;
Original file line number Diff line number Diff line change @@ -650,9 +650,17 @@ public Credentials getScopedCredentials() {
650650 && ((GoogleCredentials ) credentials ).createScopedRequired ()) {
651651 credentialsToReturn = ((GoogleCredentials ) credentials ).createScoped (getScopes ());
652652 }
653+ if (useSelfSignedJwt () && credentialsToReturn instanceof ServiceAccountCredentials ) {
654+ credentialsToReturn =
655+ ((ServiceAccountCredentials ) credentialsToReturn ).createWithUseJwtAccessWithScope (true );
656+ }
653657 return credentialsToReturn ;
654658 }
655659
660+ protected boolean useSelfSignedJwt () {
661+ return true ;
662+ }
663+
656664 /** Returns configuration parameters for request retries. */
657665 public RetrySettings getRetrySettings () {
658666 return retrySettings ;
You can’t perform that action at this time.
0 commit comments