pnp / pnp/pnpframework

Page Timeout Exception while create SharePoint Client Context using PNP.Framework in ASP.Net Site

Open
#452 1 comment 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

I have an Azure ASP.Net Web site. In page load event, creating SharePoint Client Context using Azure AD Application.

Page keeps on loading and after some time shows page timeout exception. Using below code to create SharePoint Client Context. This code is working in console application but not in ASP.Net page. Please let me know how to fix this.

public static ClientContext GetClientContextFromrAzureApp(string siteURL, X509Certificate2 CertApp)
{
string tenantId = "dbc1c245-33df-411f-a421-...";
string ClientId = "7f4ff27b-4200-4cba-a666-....";// Azure AD Application ID

using (var manager = new PnP.Framework.AuthenticationManager(ClientId, new X509Certificate2(CertApp), tenantId, "", AzureEnvironment.USGovernmentHigh))
{
	manager.ClearTokenCache();
	return manager.GetContext(siteURL);
}

}

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 GetClientContextFromrAzureApp and compare its execution in the ASP.Net page-load path with the working console application. Reproduce the timeout and inspect the PnP.Framework AuthenticationManager and certificate-based Azure AD setup; done means SharePoint ClientContext creation completes without the page timing out.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
authentication, backend, cloud
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.