Skip to content

Commit 34193d2

Browse files
Merge pull request SharePoint#8235 from callumbwhyte/security-pnp-framework
Update security docs to use PnP Framework
2 parents 9ed8424 + e2175b7 commit 34193d2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Granting access using SharePoint App-Only
33
description: Granting access using SharePoint App-Only
4-
ms.date: 06/13/2022
4+
ms.date: 06/28/2022
55
ms.prod: sharepoint
66
author: vesajuvonen
77
ms.author: vesaj
@@ -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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Granting access via Azure AD App-Only
33
description: Granting access via Azure AD App-Only
4-
ms.date: 06/05/2020
4+
ms.date: 06/28/2022
55
ms.prod: sharepoint
66
author: vesajuvonen
77
ms.author: vesaj
@@ -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)