Hi,
Thanks a lot for your reply. This is the documentation I followed: https://github.com/microsoftgraph/msgraph-sdk-php
and this is my code:
$tenantId = '--------------';
$clientId = '--------------';
$clientSecret = '--------------';
$guzzle = new \GuzzleHttp\Client();
$url = 'https://login.microsoftonline.com/' . $tenantId . '/oauth2/token?api-version=beta';
$token = json_decode($guzzle->post($url, [
'form_params' => [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'resource' => 'https://graph.microsoft.com/',
'grant_type' => 'client_credentials',
],
])->getBody()->getContents());
$accessToken = $token->access_token;
$graph = new \Microsoft\Graph\Graph();
$graph->setBaseUrl("https://graph.microsoft.com/")
->setApiVersion("beta")
->setAccessToken($accessToken);
...
so I think I'm specifying the correct tenant to point, right?
For my tests, I used a brand new test account, not my original one.