diff --git a/packages/google-cloud-redis/src/v1/cloud_redis_client.ts b/packages/google-cloud-redis/src/v1/cloud_redis_client.ts index ae3c9113812..ec52ccba323 100644 --- a/packages/google-cloud-redis/src/v1/cloud_redis_client.ts +++ b/packages/google-cloud-redis/src/v1/cloud_redis_client.ts @@ -147,6 +147,12 @@ export class CloudRedisClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -1896,6 +1902,7 @@ export class CloudRedisClient { return this.cloudRedisStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts index 3ff0c762835..5a1f33ec73e 100644 --- a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts +++ b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts @@ -147,6 +147,12 @@ export class CloudRedisClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -1886,6 +1892,7 @@ export class CloudRedisClient { return this.cloudRedisStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve();