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, String certificatePath, SecureString certificatePassword, 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

certificatePath

  Type: System.String
  The path to the certificate (*.pfx) file on the file system

certificatePassword

  Type: System.Security.SecureString
  Password to the certificate

(optional) environment

  Type: OfficeDevPnP.Core.AzureEnvironment
  SharePoint environment being used

Return Value

Type: ClientContext
Client context object

See also

© 2018 Microsoft