diff --git a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts index c7809e94b59..b69f99af5be 100644 --- a/packages/google-cloud-securitycenter/src/v1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1/security_center_client.ts @@ -133,6 +133,12 @@ export class SecurityCenterClient { // 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; @@ -5693,6 +5699,7 @@ export class SecurityCenterClient { return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts index 5d1412ee9cc..3b93e9ee0c1 100644 --- a/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1beta1/security_center_client.ts @@ -133,6 +133,12 @@ export class SecurityCenterClient { // 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; @@ -3721,6 +3727,7 @@ export class SecurityCenterClient { return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts index eb476ff8637..862f4607248 100644 --- a/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts +++ b/packages/google-cloud-securitycenter/src/v1p1beta1/security_center_client.ts @@ -133,6 +133,12 @@ export class SecurityCenterClient { // 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; @@ -5669,6 +5675,7 @@ export class SecurityCenterClient { return this.securityCenterStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve();