Home > Mobile >  sharepoint online api error authenticating
sharepoint online api error authenticating

Time:05-10

getting this error trying to authenticate sharepoint online:

context_auth = AuthenticationContext(url=app_settings['url']) TypeError: AuthenticationContext.init() got an unexpected keyword argument 'url'

Process finished with exit code 1

image with code here

CodePudding user response:

From what I gathered from your error, AuthenticationContext() doesn't have a url parameter.

From the code:

https://github.com/vgrem/Office365-REST-Python-Client/blob/master/office365/runtime/auth/authentication_context.py

it looks like the parameter is actually authority_url.

So:

context_auth = AuthenticationContext(url=app_settings['url'])

should really be:

context_auth = AuthenticationContext(app_settings['url'])

Assuming the app_settings['url'] is the correct authority url.

  • Related