Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth error with 2.1.7 #174

Closed
asukumar91 opened this issue Mar 3, 2020 · 13 comments
Closed

Auth error with 2.1.7 #174

asukumar91 opened this issue Mar 3, 2020 · 13 comments
Labels

Comments

@asukumar91
Copy link

asukumar91 commented Mar 3, 2020

I constantly get the below error while trying to connect to SharePoint,

An error occurred while retrieving auth cookies from https://xxxx.sharepoint.com/sites/xxxx//_forms/default.aspx?wa=wsignin1.0

@vgrem vgrem added the question label Mar 8, 2020
@vgrem
Copy link
Owner

vgrem commented Mar 8, 2020

Greetings!

@asukumar91, could you please share some details regarding the error, are you utilizing user credentials flow:

if ctx_auth.acquire_token_for_user(username, password):
  ctx = ClientContext(url, ctx_auth)

If yes, is multi-factor authentication enabled for this account?

Have you tried with client credentials instead(refer Granting access using SharePoint App-Only on how to configure app-only principal):

if ctx_auth.acquire_token_for_app(client_id, client_secret):
  ctx = ClientContext(url, ctx_auth)

@timurgen
Copy link
Contributor

timurgen commented Mar 9, 2020

I have the same issue when trying to authenticate by using user credentials flow acquire_token_for_user for an user without multi-factor authentication and this user on the same tenant could authenticate without problem some weeks ago.

image

Version 2.1.6 works without errors.

@Smurphy000
Copy link

I am have this exact issue with version 2.1.7. Have had to revert back to 2.1.6 for the time being.

@OFFICE365USER
Copy link

OFFICE365USER commented Mar 20, 2020

This appears to be a change on the python client side, by hardcoding the authentication URL I was able to get it to work.
Change https://github.com/vgrem/Office365-REST-Python-Client/blob/master/office365/runtime/auth/saml_token_provider.py#L192 to use a URL of 'https://company-name.sharepoint.com/_forms/default.aspx?wa=wsignin1.0'

Until this is fixed I will be reverting back to 2.1.5. pip install Office365-REST-Python-Client==2.1.5

@domdinicola
Copy link
Contributor

domdinicola commented Mar 20, 2020

@vgrem I'm getting the same issue... this is blocking

<requests.sessions.Session object at 0x7f43dd045190>
(Pdb++) session.post(self.__sts_profile.signInPageUrl, data=security_token, headers={'Content-Type': 'application/x-www-form-urlencoded'})
<Response [403]>
(Pdb++) self.sts_profile.signInPageUrl
'https://XXX.sharepoint.com/sites/YYY/_forms/default.aspx?wa=wsignin1.0'

@vgrem
Copy link
Owner

vgrem commented Mar 30, 2020

Greetings!

I believe the error should no longer occur with a new release

@vgrem vgrem closed this as completed Mar 30, 2020
@desember
Copy link

Hi, can you also push new release to PyPI? It still has version 2.1.7.post1
https://pypi.org/project/Office365-REST-Python-Client/#history

Thx.

@domdinicola
Copy link
Contributor

@vgrem you should fine a way to automatize the upload of package after release

@domdinicola
Copy link
Contributor

meanwhile package is released we can use https://pypi.org/project/office365-rest-client/

@pobs93
Copy link

pobs93 commented Jun 9, 2020

Good Afternoon,

I´ve been trying to connect to my Sharepoint account for days and it has been impossible.

I have tried all the versions relased from 2.1.5. untill the actual 2.1.9, and I always get the same error.

**_An error occurred while retrieving token from XML response: AADSTS500069: The element with ID 'XXX' was either unsigned or the signature was invalid.

An error occurred while retrieving auth cookies from https://XXX.sharepoint.com/_vti_bin/idcrl.svc_**

Does anybody know how to fix this error? I´ve been trying everything and I can´t make it work

Thanks.

@pThonprogrammer
Copy link

I am having the same issue "error occurred while retrieving token from XML response: AADSTS500069: The element with ID...XXX was either unsigned or the signature was invalid" with version 2.1.9.

Thanks.

@pobs93
Copy link

pobs93 commented Jun 18, 2020

Hello,

I recomend you to follow the steps of this post, #207

I had this error and now it´s fixed

Regards

@pThonprogrammer
Copy link

Hi,

I am able to solve the error AADSTS500069 by following steps on #207.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants