Office365-rest-python-client: Error An error occurred while retrieving token: AADSTS90023: Invalid STS request

Created on 8 Aug 2019  ·  2Comments  ·  Source: vgrem/Office365-REST-Python-Client

Hi, I am new with this library and when I tried use it, it give me this error.
An error occurred while retrieving token: AADSTS90023: Invalid STS request.
An error occurred while retrieving auth cookies
File ".\LeyendoExcel.py", line 16, in
ctx.execute_query()
return 'FedAuth=' + self.FedAuth + '; rtFa=' + self.rtFa
TypeError: can only concatenate str (not "NoneType") to str
Can any help me?

bug

Most helpful comment

If you want to encode it in python, you can also push the url through the parse.quote function of urllib.

>>> import urllib.parse
>>> urllib.parse.quote("https://www.google.co.uk/test&page/", safe=':/')
'https://www.google.co.uk/test%26page/'

All 2 comments

I have had this problem. I found that having a symbol in the URL was my cause.
URL's need to be encoded I think.
I had a '&' in my URL, changin it to '%26' did the job.
Try this: https://www.urlencoder.io/

If you want to encode it in python, you can also push the url through the parse.quote function of urllib.

>>> import urllib.parse
>>> urllib.parse.quote("https://www.google.co.uk/test&page/", safe=':/')
'https://www.google.co.uk/test%26page/'
Was this page helpful?
0 / 5 - 0 ratings