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

AuthenticationManager.GetAzureADNativeApplicationAuthenticatedContext Method

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

Returns a SharePoint ClientContext using Azure Active Directory authentication. This requires that you have a Azure AD Native Application registered. The user will be prompted for authentication.

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

Syntax

public ClientContext GetAzureADNativeApplicationAuthenticatedContext(String siteUrl, String clientId, String redirectUrl, TokenCache tokenCache, AzureEnvironment environment = 0)

Parameters

siteUrl

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

clientId

  Type: System.String
  The Azure AD Native Application Client ID

redirectUrl

  Type: System.String
  The Azure AD Native Application Redirect Uri as a string

(optional) tokenCache

  Type: Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache
  Optional token cache. If not specified an in-memory token cache will be used

(optional) environment

  Type: OfficeDevPnP.Core.AzureEnvironment
  SharePoint environment being used

Return Value

Type: ClientContext
Client context object

See also

© 2018 Microsoft