Skip to content

Commit 0398d5e

Browse files
authored
Update security docs to use PnP Framework (SharePointPnPCoreOnline is deprecated)
1 parent 72eceb1 commit 0398d5e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/solution-guidance/security-apponly-azureacs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/demo -ClientId [Your
5858

5959
## Using this principal in your application using the SharePoint PnP Sites Core library
6060

61-
In a first step, you add the SharePoint PnP Sites Core library nuget package: https://www.nuget.org/packages/SharePointPnPCoreOnline. Once that’s done you can use below code construct:
61+
In a first step, you add the PnP Framework library nuget package: https://www.nuget.org/packages/PnP.Framework. Once that’s done you can use below code construct:
6262

6363
```csharp
6464
string siteUrl = "https://contoso.sharepoint.com/sites/demo";
65-
using (var cc = new AuthenticationManager().GetAppOnlyAuthenticatedContext(siteUrl, "[Your Client ID]", "[Your Client Secret]"))
65+
using (var cc = new AuthenticationManager().GetACSAppOnlyContext(siteUrl, "[Your Client ID]", "[Your Client Secret]"))
6666
{
6767
cc.Load(cc.Web, p => p.Title);
6868
cc.ExecuteQuery();

docs/solution-guidance/security-apponly-azuread.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ You can now perform operations through PnP PowerShell against your SharePoint On
233233

234234
## Using this principal in your application using the SharePoint PnP Sites Core library
235235

236-
In a first step, you add the SharePointPnPCoreOnline library NuGet package: https://www.nuget.org/packages/SharePointPnPCoreOnline.
236+
In a first step, you add the PnP Framework library NuGet package: https://www.nuget.org/packages/PnP.Framework.
237237

238238
Once that’s done you can use below code construct:
239239

240240
```csharp
241-
using OfficeDevPnP.Core;
241+
using PnP.Framework;
242242
using System;
243243

244244
namespace AzureADCertAuth
@@ -247,8 +247,8 @@ namespace AzureADCertAuth
247247
{
248248
static void Main(string[] args)
249249
{
250-
string siteUrl = "https://contoso.sharepoint.com/sites/demo";
251-
using (var cc = new AuthenticationManager().GetAzureADAppOnlyAuthenticatedContext(siteUrl, "<application id>", "contoso.onmicrosoft.com", @"C:\BertOnlineAzureADAppOnly.pfx", "<password>"))
250+
var authManager = new AuthenticationManager("<application id>", "c:\\temp\\mycert.pfx", "<password>", "contoso.onmicrosoft.com");
251+
using (var cc = authManager.GetAzureADAppOnlyAuthenticatedContext("https://contoso.sharepoint.com/sites/demo"))
252252
{
253253
cc.Load(cc.Web, p => p.Title);
254254
cc.ExecuteQuery();

0 commit comments

Comments
 (0)