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

401 Client Error: Unauthorized #902

Open
lastorder999 opened this issue Oct 11, 2024 · 0 comments
Open

401 Client Error: Unauthorized #902

lastorder999 opened this issue Oct 11, 2024 · 0 comments
Labels

Comments

@lastorder999
Copy link

My program for uploading files to SharePoint was working normally until last week. Now, I see an error occurring during the upload process. I tested it using this code, and it’s giving me an error.

from office365.runtime.auth.client_credential import ClientCredential
from office365.sharepoint.client_context import ClientContext

client_id = "[client_id]"
client_secret = "[client_secret]
site_url = "https://example.sharepoint.com/site/ShareDoc"

client_credentials = ClientCredential(client_id, client_secret)
ctx = ClientContext(site_url).with_credentials(client_credentials)
web = ctx.web
ctx.load(web)
ctx.execute_query()

This is the error I received
Screenshot 2024-10-11 154020

Screenshot 2024-10-11 154048

I followed this link for my client_id and client_secret https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
I don’t understand why this issue is happening because it was normal before.

@vgrem vgrem added the question label Dec 8, 2024
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

2 participants