0

I have the following code to connect to SharePoint using clientID and ClientSecret:

string siteUrl = "https://****l.sharepoint.com/sites/DocumentApprovalProcess/";
string clientId = "***";
string clientSecret = "**";

using (var context = new AuthenticationManager().GetAppOnlyAuthenticatedContext(siteUrl, clientId, clientSecret))

But I am getting this error:

'AuthenticationManager' does not contain a constructor that takes 0 arguments

2
  • 1
    Which version of SharePoint and CSOM are you using? Sep 25, 2020 at 4:10
  • @GaneshSanap i am using sharepoint online and CSOM version 16.0.0.0
    – John John
    Sep 25, 2020 at 8:59

1 Answer 1

1

The method is in OfficeDevPnP.Core. You need to install OfficeDevPnP.Core.

Reference: https://docs.microsoft.com/en-us/dotnet/api/officedevpnp.core.authenticationmanager.getapponlyauthenticatedcontext

https://www.c-sharpcorner.com/article/connect-to-sharepoint-online-site-with-app-only-authentication/

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.