diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java index 51b168a259c9..0b801c7df905 100644 --- a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java @@ -245,7 +245,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java index 9b5520965af9..764066829c92 100644 --- a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java @@ -246,7 +246,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */