pnp / pnp/pnpframework

Intermittent 401 Unauthorized Error When Using App Only Secret Authentication

Open
#810 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

using (ClientContext cc = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, clientID, clientSecret))
{
cc.Load(cc.Web, p => p.Title);
cc.ExecuteQuery();
Console.WriteLine(cc.Web.Title);
}

We have used GetACSAppOnlyContext and able to connect to sharepoint by using clientid and clientsecret but intermittently we are getting 401 error while downloading, uploading documents in the sharepoint and after sometime its works. Is it token refresh issue? could you please help here. Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with AuthenticationManager.GetACSAppOnlyContext and investigate the intermittent 401 responses during SharePoint document uploads and downloads. Reproduce the failure if possible, then identify whether token refresh or another authentication path causes it and verify that repeated operations complete without unauthorized errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.