public static CreateAppEventClientContext ( SPRemoteEventProperties properties, bool useAppWeb ) : ClientContext | ||
properties | SPRemoteEventProperties | Properties of an app event |
useAppWeb | bool | True to target the app web, false to target the host web |
return | ClientContext |
public static ClientContext CreateAppEventClientContext(SPRemoteEventProperties properties, bool useAppWeb)
{
if (properties.AppEventProperties == null)
{
return null;
}
Uri sharepointUrl = useAppWeb ? properties.AppEventProperties.AppWebFullUrl : properties.AppEventProperties.HostWebFullUrl;
if (IsHighTrustApp())
{
return GetS2SClientContextWithWindowsIdentity(sharepointUrl, null);
}
return CreateAcsClientContextForUrl(properties, sharepointUrl);
}