AuthenticationManager.GetAppOnlyAuthenticatedContext Method

Definition

Overloads

GetAppOnlyAuthenticatedContext(String, String, String)

Returns an app only ClientContext object

GetAppOnlyAuthenticatedContext(String, String, String, AzureEnvironment)

Returns an app only ClientContext object

GetAppOnlyAuthenticatedContext(String, String, String, String, String, String)

Returns an app only ClientContext object

GetAppOnlyAuthenticatedContext(String, String, String)

Returns an app only ClientContext object

public Microsoft.SharePoint.Client.ClientContext GetAppOnlyAuthenticatedContext (string siteUrl, string appId, string appSecret);
member this.GetAppOnlyAuthenticatedContext : string * string * string -> Microsoft.SharePoint.Client.ClientContext
Public Function GetAppOnlyAuthenticatedContext (siteUrl As String, appId As String, appSecret As String) As ClientContext

Parameters

siteUrl
String

Site for which the ClientContext object will be instantiated

appId
String

Application ID which is requesting the ClientContext object

appSecret
String

Application secret of the Application which is requesting the ClientContext object

Returns

ClientContext

ClientContext to be used by CSOM code

GetAppOnlyAuthenticatedContext(String, String, String, AzureEnvironment)

Returns an app only ClientContext object

public Microsoft.SharePoint.Client.ClientContext GetAppOnlyAuthenticatedContext (string siteUrl, string appId, string appSecret, OfficeDevPnP.Core.AzureEnvironment environment = OfficeDevPnP.Core.AzureEnvironment.Production);
member this.GetAppOnlyAuthenticatedContext : string * string * string * OfficeDevPnP.Core.AzureEnvironment -> Microsoft.SharePoint.Client.ClientContext
Public Function GetAppOnlyAuthenticatedContext (siteUrl As String, appId As String, appSecret As String, Optional environment As AzureEnvironment = OfficeDevPnP.Core.AzureEnvironment.Production) As ClientContext

Parameters

siteUrl
String

Site for which the ClientContext object will be instantiated

appId
String

Application ID which is requesting the ClientContext object

appSecret
String

Application secret of the Application which is requesting the ClientContext object

environment
AzureEnvironment

SharePoint environment being used

Returns

ClientContext

ClientContext to be used by CSOM code

GetAppOnlyAuthenticatedContext(String, String, String, String, String, String)

Returns an app only ClientContext object

public Microsoft.SharePoint.Client.ClientContext GetAppOnlyAuthenticatedContext (string siteUrl, string realm, string appId, string appSecret, string acsHostUrl = "accesscontrol.windows.net", string globalEndPointPrefix = "accounts");
member this.GetAppOnlyAuthenticatedContext : string * string * string * string * string * string -> Microsoft.SharePoint.Client.ClientContext
Public Function GetAppOnlyAuthenticatedContext (siteUrl As String, realm As String, appId As String, appSecret As String, Optional acsHostUrl As String = "accesscontrol.windows.net", Optional globalEndPointPrefix As String = "accounts") As ClientContext

Parameters

siteUrl
String

Site for which the ClientContext object will be instantiated

realm
String

Realm of the environment (tenant) that requests the ClientContext object

appId
String

Application ID which is requesting the ClientContext object

appSecret
String

Application secret of the Application which is requesting the ClientContext object

acsHostUrl
String

Azure ACS host, defaults to accesscontrol.windows.net but internal pre-production environments use other hosts

globalEndPointPrefix
String

Azure ACS endpoint prefix, defaults to accounts but internal pre-production environments use other prefixes

Returns

ClientContext

ClientContext to be used by CSOM code

Applies to