// v1.x
$accessToken = getAccessToken(); // custom token retrieval method
$graph = new Graph();
$graph->setAccessToken($accessToken);
$graph ->createRequest('GET', '/me')
->setAccessToken(getAccessToken()) //after initial token expires
...
// v2.0-RC
$tokenRequestContext = new AuthorizationCodeContext(
'tenantId',
'clientId',
'clientSecret',
'authCode',
'redirectUri'
);
$scopes = ['User.Read', 'Mail.Read'];
$authProvider = new PhpLeagueAuthenticationProvider($tokenRequestContext, $scopes);
Last active
July 6, 2022 19:50
-
-
Save sebastienlevert/2777f24d792afef90a661492ed65fbcb to your computer and use it in GitHub Desktop.
Auth sample for Microsoft Graph PHP SDK 2.0.0-RC5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment