Home > Enterprise >  Python connection Sharepoint Online authentication problem
Python connection Sharepoint Online authentication problem

Time:09-16

Use shareplum, but has been unable to certification through, return an error,
Please guide or connection certification can also use other way,

 
The from shareplum import Site
The from shareplum import blog
The from shareplum. Site import Version


SharepointUsername="[email protected]"

SharepointPassword="ABC @ 123
"
SharepointSite="https://abc.sharepoint.cn/sites/mysite"

Website="https://abc.sharepoint.cn"

Authcookie=the blog (website, username=sharepointUsername, password=sharepointPassword). GetCookies ()

Site=site (sharepointSite, version=version. V365, authcookie=authcookie)


Return an error is as follows:
Exception: (' Error authenticating against Office 365. Was not able to find the an Error code. Here is the SOAP response from Office 365 ', b '& lt; ? The XML version="1.0" encoding="utf-8"? & gt; The 2020-07-14 T03:16:02. 0376486 z & lt;/wsu: Created> The 2020-07-14 T03:21:02. 0376486 z & lt;/wsu: Expires> https://twsgroup.sharepoint.cn 0 x8004882c & lt;/PSF: reqstatus> 0 x80045b00 & lt;/PSF: errorstatus> ')

CodePudding user response:

https://pypi.org/project/Office365-REST-Python-Client/
Try this one, I can't even SharePoint couldn't try

CodePudding user response:

reference 1/f, Justin - Liu reply:

https://pypi.org/project/Office365-REST-Python-Client/Try this one, I don't even try SharePoint couldn't


Tried but the same error, as follows:
 
From the blog. Runtime. The auth. Authentication_context import AuthenticationContext
From the blog. Sharepoint. Client_context import ClientContext

Ctx_auth=AuthenticationContext (" https://abc.sharepoint.cn ")
If ctx_auth. Acquire_token_for_user (" [email protected] ", "abc123") :
CTX=ClientContext (url, ctx_auth)
Web=CTX. Web
CTX. Load (web)
CTX. Execute_query ()
Print (" Web title: {0} ". The format (Web) properties [' title ']))

The else:
Print (ctx_auth. Get_last_error ())


Error message: always get a binary security token for the from https://login.microsoftonline.com/extSTS.srf
KeyError: 'FedAuth'

Point into The links in The error message is Microsoft's official error message: The endpoint only accepts POST requests, Received a GET request.

CodePudding user response:

Error message is quite understand, you look at it to making, I couldn't get on
  • Related