Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

ClientCredential missing client_secret in request body

Open guidorietbroek opened this issue 2 years ago • 1 comments

After following the instructions for an app principal and using below code:

`site_url = "https://{}.sharepoint.com/sites".format(MS_TENANT)

client_credentials = ClientCredential(client_id=MS_CLIENT_ID, client_secret=MS_CLIENT_SECRET) ctx = ClientContext(site_url).with_credentials(client_credentials)

web = ctx.web ctx.load(web) ctx.execute_query()`

I get the following error:

"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: 'client_secret'.

I tried different app principals from different locations in Sharepoint (root and specific site). When using the user credentials, I get the error that it's not possible due to MFA settings, so this option seems to be working.

guidorietbroek avatar Jun 28 '23 05:06 guidorietbroek

@guidorietbroek Did you manage to figure this out?

b4rlw avatar Aug 27 '24 23:08 b4rlw