【发布时间】:2013-02-04 09:29:19
【问题描述】:
我正在将代码从 2010 年迁移到 2013 年。
我在 Sharepoint 中部署了一个调用 PSI 的用户控件。 2010 年,它运作良好。现在在 2013 年和声明身份验证中,我总是得到:“HTTP 请求未经客户端身份验证方案'Ntlm' 的授权。从服务器收到的身份验证标头是'NTLM,Negotiate'。”当我与任何用户(甚至项目管理员)调用任何 PSI(甚至 GetCurrentUserUid)时。
看起来凭据没有传递给 PSI,它称它们为匿名。有人可以帮忙吗?
我从 Sharepoint 执行的另一个代码示例:
ProjectContext projContext = new ProjectContext(PROJECT_SERVER_URL);
projContext.Load(projContext.EnterpriseResources);
projContext.ExecuteQuery();
我的访问被拒绝。
谢谢
【问题讨论】:
-
您是否修改了您的 app.config?查看my answer here 的后半部分,查看您需要修改的部分。
-
@Kit 在我的例子中是 web.config。我通过代码配置客户端,因此 web.config 中没有任何内容。
this.HttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);this.HttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
标签: sharepoint-2013 psi ms-project-server-2013