phpSPO
phpSPO copied to clipboard
Fatal error: Uncaught Error: Class 'AuthenticationContext'
When I include require_once 'vendor/autoload.php' i found below error :
Fatal error: Uncaught Error: Class 'AuthenticationContext'
How can i get a list of the item using SharePoint rest API?
I have the same issue, did you already fix this? I've installed the phpSPO plugin via the composer on a windows machine. No errors. The vendor directory was created in the root directory. After loading the autoload.php i get the same as error as mentioned.
The following simple piece of code is generating the error message:
require_once(__DIR__ . '/vendor/autoload.php');
$authCtx = new AuthenticationContext($Url);
$authCtx->acquireTokenForUser($UserName,$Password); //authenticate
Hopefully someone can help?
added the following in my script. use Office365\PHP\Client\Runtime\Auth\AuthenticationContext; use Office365\PHP\Client\SharePoint\ClientContext; use Office365\PHP\Client\SharePoint\ListCreationInformation; use Office365\PHP\Client\SharePoint\SPList; this fixed the issue.
I propose to close since the issue is resolved.
I don't understand why this is closed. I am getting the same problem under Linux using the example script. breugela's workaround is just a workaround, not a proper solution.
I got the same problem and agree with @nneil
Getting same error, Is anybody solve this ?