Refactored and added test to get user information with GraphAPI

This commit is contained in:
sagargurung1001@gmail.com
2022-11-22 13:03:56 +05:45
parent 1a8c4008d1
commit 82049df3ee
3 changed files with 137 additions and 9 deletions
+25
View File
@@ -181,6 +181,31 @@ class GraphHelper {
);
}
/**
* @param string $baseUrl
* @param string $xRequestId
* @param string $user
* @param string $userPassword
*
* @return ResponseInterface
* @throws GuzzleException
*/
public static function getUserInformation(
string $baseUrl,
string $xRequestId,
string $user,
string $userPassword
): ResponseInterface {
$url = self::getFullUrl($baseUrl, 'me/?%24expand=memberOf');
return HttpRequestHelper::get(
$url,
$xRequestId,
$user,
$userPassword,
self::getRequestHeaders()
);
}
/**
* @param string $baseUrl
* @param string $xRequestId