krizalys / onedrive-php-sdk

OneDrive SDK for PHP
BSD 3-Clause "New" or "Revised" License
144 stars 66 forks source link

Error with Client->obtainAccessToken #112

Open Labyala opened 1 year ago

Labyala commented 1 year ago

Hello,

i'm trying to run the code in the example but i've get a fatal error in redirect.php

`PHP Fatal error: Uncaught Exception: The state's redirect URI must be set to call obtainAccessToken() in /xxxx/xxxx/xxxx/xxxx/vendor/krizalys/onedrive-php-sdk/src/Client.php:293 Stack trace:

0 /xxxx/xxxx/xxxx/xxxx/redirect.php(38): Krizalys\Onedrive\Client->obtainAccessToken('ULb8Q~YsGkHITQt...', 'M.C105_BL2.2.d0...')

1 {main}

thrown in /xxxx/xxxx/xxxx/xxxx/vendor/krizalys/onedrive-php-sdk/src/Client.php on line 293`

i don't understand what i'm doing wrong, can anyone help me ? thanks

Sisytec commented 1 year ago

the same issue here thanks!

smartcmsteam commented 1 year ago

Do you solve the problem?

GenieTim commented 9 months ago

Check whether your $_SESSION actually contains the state of the client; in the example, the code involving $_SESSION is what sets the approporiate redirect URI that is asked for here.