thybag / PHP-SharePoint-Lists-API

A simple PHP API to make working with SharePoint lists easy.
MIT License
184 stars 95 forks source link

Notice: A non well formed numeric value encountered & Error : Uncaught Exception: AADSTS50126 #162

Open dadwarf opened 4 years ago

dadwarf commented 4 years ago

Hi, I'm sure about my credentials, it's an email and an alphanuméric password. What ever i try to check i have this 👍

`PHP Notice: A non well formed numeric value encountered in xxx\Thybag\Auth\SharePointOnlineAuth.php on line 99

Notice: A non well formed numeric value encountered in xxx\Thybag\Auth\SharePointOnlineAuth.php on line 99

PHP Fatal error: Uncaught Exception: AADSTS50126: Error validating credentials due to invalid username or password. in xxx\Thybag\Auth\SharePointOnlineAuth.php:99 Stack trace:

0 xxx\Thybag\Auth\SharePointOnlineAuth.php(20): Thybag\Auth\SharePointOnlineAuth->configureAuthCookies(Array)

1 [internal function]: Thybag\Auth\SharePointOnlineAuth->__doRequest('<?xml version="...', 'https://xxx...', 'http://schemas....', 1, 0)

2 xxx\Thybag\SharePointAPI.php(278): SoapClient->__call('GetListCollecti...', Array)

3 xxx\index.php(11): Thybag\SharePointAPI->getLists()

4 {main}

thrown in xxx\Thybag\Auth\SharePointOnlineAuth.php on line 99`

<?PHP include("SharePointAPI.php"); $wsdl = "https://xxx.sharepoint.com/sites/xxx/_vti_bin/Lists.asmx?WSDL"; $sp = new \Thybag\SharePointAPI("xxx@xxx", "xxx", $wsdl, "SPONLINE"); print_r($sp->getLists()); ?>

Could you help me ? Thanks

inuru commented 4 years ago

I faced the exact problem. Have you found the solution?

jasonalsing commented 3 years ago

Wish this could be resolved. I am migrating from using this on SP2013 (NTLM) to SharePointOnline and was hoping for an easy update to my scripts but using SPONLINE authentication to my new site is not working.

JIGR1969 commented 1 year ago

I'm currently experiencing this problem as well and was wondering if anyone had managed to resolve it?

The credentials I am using work okay when logging onto SharePoint and viewing the list in question. When creating a new API instance using SPONLINE in order to connect to SP, it does not give an error, the error only comes about when trying to access a list.

Not sure if this means that a connection is only made when accessing a list or doing anything with the lists, or if the error is being misreported. If you look at the exception, it talks about credentials being incorrect, but not sure if that is 100% the case.

If I get this working, it'll open a whole new world of possibilities for me in terms of data manipulation. I would use the Microsoft Graph API which I'm sure would work fine, except the company I work for, literally don't want anyone to have access even if it is simply to read the data contained within the lists. :(

jasonalsing commented 1 year ago

I ended up finding an alternate library as this issue was already 1+ year old when I encountered the issue and there were no comments from the developer I assumed the project was dead. Ultimately I landed on https://github.com/vgrem/phpSPO which did not have quite as easy parsing of the list but at least the SPO login worked (as well as supports client secret login which my company moved to as well)