Table of contents
TOC
Collapse the table of content
Expand the table of content

AuthenticationManager.GetAzureADAppOnlyAuthenticatedContext Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Returns a SharePoint ClientContext using Azure Active Directory App Only Authentication. This requires that you have a certificated created, and updated the key credentials key in the application manifest in the azure AD accordingly.

Namespace:OfficeDevPnP.Core
Assembly: OfficeDevPnP.Core.dll

Syntax

public ClientContext GetAzureADAppOnlyAuthenticatedContext(String siteUrl, String clientId, String tenant, StoreName storeName, StoreLocation storeLocation, String thumbPrint, AzureEnvironment environment = 0)

Parameters

siteUrl

  Type: System.String
  Site for which the ClientContext object will be instantiated

clientId

  Type: System.String
  The Azure AD Application Client ID

tenant

  Type: System.String
  The Azure AD Tenant, e.g. mycompany.onmicrosoft.com

storeName

  Type: System.Security.Cryptography.X509Certificates.StoreName
  The name of the store for the certificate

storeLocation

  Type: System.Security.Cryptography.X509Certificates.StoreLocation
  The location of the store for the certificate

thumbPrint

  Type: System.String
  The thumbprint of the certificate to locate in the store

(optional) environment

  Type: OfficeDevPnP.Core.AzureEnvironment
  SharePoint environment being used

Return Value

Type: ClientContext
ClientContext being used

See also

© 2018 Microsoft