microsoftgraph/php-connect-rest-sample

Something went wrong, couldn't get tokens: invalid_client

Closed this issue · 4 comments

`Notice: Use of undefined constant clientId - assumed 'clientId' in C:\xampp\htdocs\app\oauth.php on line 30

Notice: Use of undefined constant clientSecret - assumed 'clientSecret' in C:\xampp\htdocs\app\oauth.php on line 31

Notice: Use of undefined constant redirectUri - assumed 'redirectUri' in C:\xampp\htdocs\app\oauth.php on line 32

Notice: Use of undefined constant urlAuthorize - assumed 'urlAuthorize' in C:\xampp\htdocs\app\oauth.php on line 33

Notice: Use of undefined constant urlAccessToken - assumed 'urlAccessToken' in C:\xampp\htdocs\app\oauth.php on line 34

Notice: Use of undefined constant urlResourceOwnerDetails - assumed 'urlResourceOwnerDetails' in C:\xampp\htdocs\app\oauth.php on line 35

Notice: Use of undefined constant scopes - assumed 'scopes' in C:\xampp\htdocs\app\oauth.php on line 36

Notice: Use of undefined constant code - assumed 'code' in C:\xampp\htdocs\app\oauth.php on line 59
Something went wrong, couldn't get tokens: invalid_client`

I just started a new project, what is wrong here ? I logged in with a buisness microsoft account, and then these erroes appear.

Thanks for sharing this. Have you updated the corresponding clientId and clientSecret values in the Constants.php file?

I'll need to check that, but as this is not mentioned in the README, i wont have done that.

Im gonna report soon.

Sorry for any confusion. Did you see these steps in the Readme?

Configure and run the app
Using your favorite IDE, open Constants.php in the src folder.
Replace ENTER_YOUR_CLIENT_ID with the application id from the previous section.
Replace ENTER_YOUR_SECRET with the password from the previous section.
Install the dependencies with the following command:
composer install
Start the built-in web server with the following command:
php -S 0.0.0.0:8000 -t app
Navigate to http://localhost:8000 in your web browser.

Closing for now. Please reopen if this continues to be an issue.