Thanks for your answer.
Could you point towards where exactly should I send a support message ?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hello ,
I've tried to access my onedrive account using a php script that I need for a web application. However I get the following error:
Fatal error: Uncaught GuzzleHttp\Exception\ServerException: Server error: POST https://login.microsoftonline.com/......./oauth2/token
resulted in a 500 Internal Server Error
response:
{"error":"server_error","error_description":"AADSTS90036: An unexpected, non-retryable error stemming from the directory (truncated...)
in /home/weblamp/public_html/onedrive/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
Below my script :
require DIR . '/vendor/autoload.php';
use Microsoft\Graph\Graph;
use Microsoft\Graph\Model;
$target_dir = "downloads/";
echo "<pre>";
$guzzle = new \GuzzleHttp\Client();
$tenantId = 'your_tenanet_id, e4c9ab4e-****-****-****-230ba2a757fb';
$clientId = 'your_app_id_registered_in_portal, dc175b96-****-****-****-ea03e56da5e7';
$clientSecret = 'app_key_generated_in_portal, /pGggH************************Zr732';
$url = 'https://login.microsoftonline.com/' . $tenantId . '/oauth2/token';
$user_token = json_decode($guzzle->post($url, [
'form_params' => [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'resource' => 'https://graph.microsoft.com/',
'grant_type' => 'password',
'username' => '.....',
'password' => '...'
],
])->getBody()->getContents());
$user_accessToken = $user_token->access_token;
echo $user_accessToken;
I created a Azure directory app, set up the permissions, got the right app id, tenant id, secret however the issue still persist.
Please help.
Thanks for your answer.
Could you point towards where exactly should I send a support message ?
Hope you're doing well.
As per the AADSTS error code documentation by Microsoft, for error code AADSTS90036, you need to raise a Support case with Microsoft to get more details on it.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.