sharepy icon indicating copy to clipboard operation
sharepy copied to clipboard

Authentication Failure: AADSTS90023: Invalid STS request

Open jbdaudet opened this issue 6 years ago • 16 comments

I'm unable to connect to sharepoint O365 with an email + password: the error message I receive seems not to have been reported yet: Invalid Request: AADSTS90023: Invalid STS request Any idea what could be causing this? The email + password successfully work with an other python package (shareplum) which unfortunately does not offer the functionalities I need.

jbdaudet avatar Dec 03 '18 05:12 jbdaudet

I'm having the same issue.

nickallan1 avatar Jul 12 '19 02:07 nickallan1

I am also having this issue. I do not have any special characters in my password etc.

SHcoding avatar Oct 17 '19 11:10 SHcoding

Same issue.

Mark531 avatar Dec 04 '19 09:12 Mark531

I tried the following change^, does not work. Any progress with this issue?

sharan21 avatar Jun 04 '20 16:06 sharan21

We also meet this issue. Our user has two Microsoft accounts. When he login into Outlook 365 and meet this error. Do you have any solution for this? Thanks.

hdkdinh avatar Feb 05 '21 07:02 hdkdinh

Please try the SharePy v2 beta that's now available on PyPI.

pip install sharepy==2.0.0b1.post2

JonathanHolvey avatar Feb 05 '21 07:02 JonathanHolvey

In my case "AADSTS90023: Invalid STS request." meant just that. The request was invalid.

The reason my SOAP request to https://login.microsoftonline.com/extSTS.srf was invalid was because I did not encode the the values in <o:Password>. If you have a character like an ampersand (&) you must replace it with "&amp;".

Just look up XMLEncoding. There will be a XML Encode function in all major programming languages.

While this might not fix your specific problem it might help out a good amount of people.

Geigco avatar Jun 24 '21 18:06 Geigco

The reason my SOAP request to https://login.microsoftonline.com/extSTS.srf was invalid was because I did not encode the the values in <o:Password>. If you have a character like an ampersand (&) you must replace it with "&amp;".

Are you sure this is the case? SharePy is already escaping any special characters in both your username and password, using the xml.sax.saxutils.escape function. This will substitute & with &amp;, which should be enough to make the XML valid.

JonathanHolvey avatar Jun 25 '21 13:06 JonathanHolvey

Same issue

MareSeestern avatar Jul 28 '21 08:07 MareSeestern

Anyone solved this issue? I am facing the same problem.

Colin-Root avatar Apr 21 '22 08:04 Colin-Root

I am facing the same problem again...

Maswdle avatar Nov 25 '22 09:11 Maswdle

我一样 image

xcx-lx avatar Dec 04 '22 03:12 xcx-lx

Same. Request Id: 19f19d8f-f085-41a0-ac0b-b0072621bf01 Correlation Id: 67352a28-fbf7-4e11-9148-6a0cc67d94d3 Timestamp: 2022-12-13T02:38:04Z Message: AADSTS90023: Invalid STS request.

ardalis avatar Dec 13 '22 02:12 ardalis

Same. Request Id: 19f19d8f-f085-41a0-ac0b-b0072621bf01 Correlation Id: 67352a28-fbf7-4e11-9148-6a0cc67d94d3 Timestamp: 2022-12-13T02:38:04Z Message: AADSTS90023: Invalid STS request.

Did you look for characters that aren't allowed in XML? This is most people's issue.

Geigco avatar Dec 13 '22 14:12 Geigco

In what? My email address is just a standard [email protected] address. And there's no way my password should be passed around as part of this. I do not have any < > & characters in my password, either, which should be the most likely culprits.

ardalis avatar Dec 13 '22 15:12 ardalis

In my case "AADSTS90023: Invalid STS request." meant just that. The request was invalid.

The reason my SOAP request to https://login.microsoftonline.com/extSTS.srf was invalid was because I did not encode the the values in <o:Password>. If you have a character like an ampersand (&) you must replace it with "&".

Just look up XMLEncoding. There will be a XML Encode function in all major programming languages.

While this might not fix your specific problem it might help out a good amount of people.

Life saving... Took me hours to find out this.

Tadaz avatar Feb 15 '24 11:02 Tadaz