post($url, [ 'form_params' => [ 'client_id' => $clientId, 'client_secret' => $clientSecret, 'scope' => 'https://graph.microsoft.com/.default', 'grant_type' => 'client_credentials', ], ])->getBody()->getContents()); $accessToken = $token->access_token; $graph = new Graph(); $graph->setAccessToken($accessToken); $user = $graph->createRequest("GET", "/groups") ->setReturnType(Model\Group::class) ->execute(); print_r($user); ?>