fix: don't send x-mc-account header for tenant-specific credentials

getMimecastClientForTenant now always uses accountCode='' so the
x-mc-account header is never sent. Sending your own account code
with tenant-specific OAuth credentials causes Mimecast to 403
(it interprets it as an invalid impersonation attempt).
This commit is contained in:
lorentz 2026-04-01 06:57:40 -04:00
parent 2f88be9ab3
commit a18d5b66bf

View file

@ -569,12 +569,11 @@ export function getMimecastClientForTenant(tenant: {
client_id: string;
client_secret: string;
base_url?: string;
account_code?: string;
}): MimecastClient {
return new MimecastClient({
clientId: tenant.client_id,
clientSecret: tenant.client_secret,
baseUrl: tenant.base_url ?? 'https://api.services.mimecast.com',
accountCode: tenant.account_code ?? '',
accountCode: '',
});
}