Reputation: 6446
We got a requirement to connect to SharePoint Online from an ASP.NET web application. For this, we have registered an app in Azure AD and given Sites.FullControl.All
application permission and added a certificate to access the Azure AD app from the ASP.NET application.
In the ASP.NET web application, to get the client context, we have used this code:
PnP.Framework.AuthenticationManager authManager = PnP.Framework.AuthenticationManager.CreateWithCertificate(clientID, certPhysicalPath, certPassword, tenantID);
var context = await authManager.GetContextAsync(siteURL);
The context we obtained here is app only context and if we insert an item in a SharePoint list, the created by for the item is shown as "SharePoint app".
We tried to give delegated permissions for AllSites.FullControl
in the same app. But we couldn't find any option to create user specific client context using PNP.Framework.
We are trying to get a user context by using web login method using PNP.Framework. Can anyone give us some pointers on how this can be done in an ASP.NET web application.
Upvotes: 0
Views: 218