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, X509Certificate2 certificate, 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

certificate

  Type: System.Security.Cryptography.X509Certificates.X509Certificate2
  Certificate used to authenticate

(optional) environment

  Type: OfficeDevPnP.Core.AzureEnvironment
  SharePoint environment being used

Return Value

Type: ClientContext

See also

© 2018 Microsoft