phpSPO icon indicating copy to clipboard operation
phpSPO copied to clipboard

Fatal error: Uncaught Error: Class 'AuthenticationContext'

Open dixitadusara opened this issue 6 years ago • 6 comments

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?

dixitadusara avatar Jul 17 '17 12:07 dixitadusara

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?

breugela avatar Sep 07 '17 21:09 breugela

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.

breugela avatar Sep 08 '17 09:09 breugela

I propose to close since the issue is resolved.

vgrem avatar Apr 18 '18 16:04 vgrem

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.

nneil avatar May 14 '18 15:05 nneil

I got the same problem and agree with @nneil

dedenker avatar Aug 14 '19 10:08 dedenker

Getting same error, Is anybody solve this ?

aman90attari avatar Jun 09 '20 07:06 aman90attari