Я подключаюсь к SharePoint Online Manager, как показано ниже: -
protected SharePointOnlineCredentials GetCredentials()
{
return new SharePointOnlineCredentials(this.UserName,
this.GetSecurePassword(this.Password));
}
Я получаю сообщение об ошибке: аргумент 'username' недействителен.
Ниже приведен класс учетных данных SharePoint Online: -
#region Assembly Microsoft.SharePoint.Client.Runtime, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
// C:\SourceCode\PDS Portal\JLL.PDS\packages\Microsoft.SharePointOnline.CSOM.16.1.4727.1200\lib\net45\Microsoft.SharePoint.Client.Runtime.dll
#endregion
using System;
using System.Net;
using System.Security;
namespace Microsoft.SharePoint.Client
{
public sealed class SharePointOnlineCredentials : ICredentials
{
public SharePointOnlineCredentials(string username, SecureString password);
public string UserName { get; }
public event EventHandler<SharePointOnlineCredentialsWebRequestEventArgs> ExecutingWebRequest;
public string GetAuthenticationCookie(Uri url);
public string GetAuthenticationCookie(Uri url, bool alwaysThrowOnFailure);
public NetworkCredential GetCredential(Uri uri, string authType);
}
}
Ниже приведен след стека. Есть идеи?
at Microsoft.SharePoint.Client.SharePointOnlineCredentials..ctor(String username, SecureString password)
at JLL.PDS.Data.SharePoint.SharePointOnlineManager.GetCredentials() in C:\SourceCode\PDS Portal\JLL.PDS\JLL.PDS.Data.SharePoint\SharePointOnlineManager.cs:line 71
at JLL.PDS.Data.SharePoint.SharePointOnlineManager.GetClientContext(String siteUrl) in C:\SourceCode\PDS Portal\JLL.PDS\JLL.PDS.Data.SharePoint\SharePointOnlineManager.cs:line 57
at JLL.PDS.Data.SharePoint.SharePointUserProfileManager.Initialize() in C:\SourceCode\PDS Portal\JLL.PDS\JLL.PDS.Data.SharePoint\SharePointUserProfileManager.cs:line 43
at JLL.PDS.Data.SharePoint.SharePointUserProfileManager.GetProfileImageData(Profile profile) in C:\SourceCode\PDS Portal\JLL.PDS\JLL.PDS.Data.SharePoint\SharePointUserProfileManager.cs:line 70
at JLL.PDS.Model.Services.ProfileSyncService.<SaveProfilesToTargetDataSource>d__6.MoveNext() in C:\SourceCode\PDS Portal\JLL.PDS\JLL.PDS.Model\Services\ProfileSyncService.cs:line 106