Ejemplo n.º 1
0
        public ClientContext GetClientContext(SpoAuthenticationMethod method, string webUrl, ExecutionContext exeuctionContext)
        {
            switch (method)
            {
            case SpoAuthenticationMethod.UserNamePassword:
                return(GetClientContextWithUserNamePassword(webUrl));

            case SpoAuthenticationMethod.SharePointAppIdentity:
                return(GetClientContextWithSharePointAppIdentity(webUrl));

            case SpoAuthenticationMethod.AzureAppIdentity:
            default:
                return(GetClientContextWithAzureAppIdentity(webUrl, exeuctionContext));
            }
        }
Ejemplo n.º 2
0
        public ClientContext GetClientContext(string webUrl, ExecutionContext exeuctionContext)
        {
            SpoAuthenticationMethod authMethod = this.GetSpoAuthenticationMethodFromAppSettings();

            return(this.GetClientContext(authMethod, webUrl, exeuctionContext));
        }