Show / Hide Table of Contents

    Class ContextUtility

    Methods for connecting to SharePoint

    Inheritance
    System.Object
    ContextUtility
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace:AzureFunctionsForSharePoint.Core
    Assembly:AzureFunctionsForSharePoint.Core.dll
    Syntax
    public class ContextUtility

    Methods

    | Improve this Doc View Source

    GetACSAccessTokens(String, String, Boolean, Boolean)

    Gets an access token for a given client id and cache key combination

    Declaration
    public static string GetACSAccessTokens(string clientId, string cacheKey, bool appOnly = false, bool fallbackToUser = true)
    Parameters
    Type Name Description
    System.String clientId

    The id of the client. This must match the client id from a SharePoint add-in manifest and a valid ClientConfiguration.

    System.String cacheKey

    A valid cache key

    System.Boolean appOnly

    Set to true for an app only token

    System.Boolean fallbackToUser

    Be the user if app only is not allowed

    Returns
    Type Description
    System.String

    An access token string

    | Improve this Doc View Source

    GetAppOnlyAccessToken(String, String)

    Declaration
    public static string GetAppOnlyAccessToken(string clientId, string cacheKey)
    Parameters
    Type Name Description
    System.String clientId
    System.String cacheKey
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetClientContext(String, String, Boolean, Boolean)

    Gets a SharePoint Microsoft.SharePoint.Client.ClientContext for a given client id and cache key combination

    Declaration
    public static ClientContext GetClientContext(string clientId, string cacheKey, bool appOnly = false, bool fallbackToUser = true)
    Parameters
    Type Name Description
    System.String clientId

    The id of the client. This must match the client id from a SharePoint add-in manifest and a valid ClientConfiguration.

    System.String cacheKey

    A valid cache key

    System.Boolean appOnly

    Set to true for an app only context

    System.Boolean fallbackToUser

    Be the user if app only is not allowed

    Returns
    Type Description
    Microsoft.SharePoint.Client.ClientContext

    A ClientContext object

    • Improve this Doc
    • View Source
    Back to top Copyright © 2016 InstantQuick
    View project on Github