Sharepoint 2010,ClientContext& 401未经授权

时间:2012-05-08 23:47:54

标签: c# authentication sharepoint-2010

我正在尝试连接到Sharepoint实例,以通过第三方工具发布一些内容。

我无法控制Sharepoint实例,但我确信我的帐户具有完全权限。

        ClientContext ctx = new ClientContext("https://thesharepointsite.com");
        ctx.Credentials = new System.Net.NetworkCredential(@"username", "password", "domain");
        Web w = ctx.Web;
        ctx.Load(w);
        ctx.ExecuteQuery();

在ExecuteQuery行上,我得到了异常:

The remote server returned an error: (401) Unauthorized.

(没有内在的例外。)

我可以确认网址&通过浏览器登录时,凭据有效。

基于this question,我的假设是权限问题。

如果是这种情况,那么我需要获得哪些许可?

其他问题'我尝试过没有成功:

401 Error - Sharepoint 2007

SharePoint Server Authentication Error

401 unauthorized exception while reading data from the document library SharePoint 2010

更新

我尝试了各种其他具有相同响应的查询。我们有一个Sharepoint,Office 365实例并且可以使用(使用Remote Authentication)。这也是我相信它的某种许可或访问相关的原因。

这是在客户的实例上。我只有一个帐户。我相信如果我要求第二个,它会有同样的问题。

2 个答案:

答案 0 :(得分:1)

询问您的SharePoint服务器管理员。他们也应该能够帮助您排除故障。如果您无法访问SharePoint,我们将无法为您提供帮助,因为问题最有可能发生在服务器端。

答案 1 :(得分:1)

事实证明这是Sharepoint服务器上的配置问题。

在Sharepoint服务器上,错误记录在事件查看器上。我能够运行上面的代码,在网络内部使用相同的凭据。

相关问题