我如下所示连接到SharePoint Online Manager:-
library(dplyr)
library(ggplot2)
set.seed(1)
df <- do.call(rbind,lapply(seq(1,20,4),function(i) data.frame(x=rnorm(50,mean=i,sd=1),y=rnorm(50,mean=i,sd=1),cluster=i)))
df$cluster <- factor(df$cluster)
label.df <- data.frame(cluster=levels(df$cluster),label=paste0("cluster: ",levels(df$cluster)))
ggplot(df,aes(x=x,y=y,color=cluster))+geom_point()+theme_minimal()+theme(legend.position="none")
我收到一条错误消息-'username'参数无效。
下面是SharePoint Online凭据类:-
protected SharePointOnlineCredentials GetCredentials()
{
return new SharePointOnlineCredentials(this.UserName,
this.GetSecurePassword(this.Password));
}
下面是堆栈跟踪。有什么想法吗?
#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);
}
}
答案 0 :(得分:1)
事实证明,用户名设置App.Config需要附加域电子邮件。例如应用设置为XYZ,我必须输入XYZ@abc.com。不是我的错,因为App.Config中存在错误。因此,每当收到此错误时,“'用户名'参数无效”。这意味着我们发送的用户名不正确。