diff --git a/src/v1/key_management_service_client.ts b/src/v1/key_management_service_client.ts index 7fee8d4f..37aff480 100644 --- a/src/v1/key_management_service_client.ts +++ b/src/v1/key_management_service_client.ts @@ -145,6 +145,12 @@ export class KeyManagementServiceClient { // 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; @@ -4090,6 +4096,7 @@ export class KeyManagementServiceClient { return this.keyManagementServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.iamClient.close(); }); } return Promise.resolve();