I am attempting to establish a connection between two tenants that belong to different Azure accounts.
I followed the post: /a/78437433/4373243
My objective is to utilize the web API of Tenant B, but with the client ID and client secret from Tenant A. However, I am currently using the tenant_id associated with Tenant B, as well as the scope (web API endpoint) of Tenant B.
Tenant B web api endpoint: https://org8885b353.api.crm.dynamics.com/
$response = $this->client->post("https://login.microsoftonline.com/{tenantB_id}/oauth2/v2.0/token", [
'timeout' => 30,
'form_params' => [
'client_id' => 'tenantA_clientId',
'client_secret' => 'tenantA_clientSecret',
'scope' => 'https://org8885b353.api.crm.dynamics.com/.default',
'grant_type' => 'client_credentials',
],
]);
When I call the URL below to get the list of all entities with the access token from $response, it throws me an error:
org8885b353.api.crm.dynamics.…
"error": {
"code": "0x80072560",
"message": "The user is not a member of the organization."
}