Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

an error occurred while retrieving auth cookies 2.3.1

Open ryanthelen55 opened this issue 4 years ago • 3 comments

I am trying to read files from a sharepoint location.

1.) Does my site url need to be where the file I want to read is located 2.) I receive this error:

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

Below is my code which I added my credentials and tenant prefix

from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.client_context import ClientContext
site_url = "https://{your-tenant-prefix}.sharepoint.com"
ctx = ClientContext(site_url).with_credentials(UserCredential("{username}", "{password}"))
web = ctx.web
ctx.load(web)
ctx.execute_query()
print("Web title: {0}".format(web.properties['Title']))

ryanthelen55 avatar Dec 17 '20 01:12 ryanthelen55

Using code that works fine in 2.2.0, I am now receiving the same error with 2.3.1.

We are federated with ADFS.

lw1959 avatar Dec 22 '20 11:12 lw1959

+1 Same issue here.

EDIT: Reverting back to 2.2.2 solved the issue.

Vel-San avatar Jan 21 '21 15:01 Vel-San

Issue persists for 2.3.4. Reverting back to 2.2.2 did not solve the issue for me.

kayx23 avatar Jun 21 '21 21:06 kayx23