Skip to content

office365.sharepoint.client_context.ClientContext with ClientCredential Support Token Refresh #947

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

Open
Digital-Thought opened this issue Mar 4, 2025 · 0 comments
Labels

Comments

@Digital-Thought
Copy link

I am initializing an instance of ClientContext via the following:

client_credentials = ClientCredential(sharepoint.client_id, sharepoint.client_secret') context = ClientContext(sharepoint.site_url).with_credentials(self.client_credentials)

It works fine, however, after an hour of running using the same instance of 'ClientContext' I get 401 errors which suggests the token is expiring and not refresshing.

I have tried to use ClientContext with the operation of 'with_access_token' however, from what I understand it is not supported for the v1 SharePoint API.

Is there a solution to achieve the token refresh using the office365.sharepoint.client_context.ClientContext?

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