cdelgehier / sharepoint-ansible-module

Ansible module to push or fetch in sharepoint
GNU General Public License v3.0
3 stars 1 forks source link

Python error from /usr/lib/python3/dist-packages/simplejson/decoder.py #3

Open fabriceverkor opened 1 week ago

fabriceverkor commented 1 week ago

Hello I'm trying to communicate with our SharePoint wih code below. I'm pretty sure that client and tenant parameters below are correct, because I change them, I get other errors (failed authentication, bad tenant name, ... )

_- sharepoint: method : list client_id: "{{ VAULT_AZURE_CLIENT_ID }}@{{ VAULT_AZURE_TENANT }}" client_secret: "{{ VAULT_AZURE_SECRET }}" tenant_name: "verkorbatteries" tenant_id: "{{ VAULT_AZURE_TENANT }}" site_name: "IT" remote_file_path: "/Shared Documents" tags: sp delegateto: localhost

The full traceback is: _Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/simplejson/init.py", line 525, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 372, in decode obj, end = self.raw_decode(s) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 402, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:_

Any idea about what is wrong ? Thx

cdelgehier commented 1 week ago

Unfortunately I no longer have a sharepoint to test. On the other hand, your client ID seems strange to me.

image https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/register-sharepoint-add-ins#to-register-by-using-appregnewaspx

Did you generate the id from the page dedicated to this purpose?

fabriceverkor commented 1 week ago

You are right. I just used an already existing registered apps to which I gave the proper Mgraph permissions.

The interface below failed to create a new app, but anyway, as said in red in screenshot below, this way to authenticate will be retired next year.

image

It probably means that your code will require modifications to fit the new way.

cdelgehier commented 1 week ago

Yep. I'm also interested in keeping this code functional. Following your issue, I requested a Microsoft Developer account, I am waiting for feedback regarding my qualification

fabriceverkor commented 1 week ago

OK. If you need me to do some tests, don't hesitate