【问题标题】:Sharepoint 2010 ClientContext with kerberos & a 401 unauthorisedSharepoint 2010 ClientContext 与 kerberos 和未经授权的 401
【发布时间】:2012-07-26 03:32:30
【问题描述】:

我可以让远程控制台应用程序使用 ClientContext 与 NTLM Sharepoint 站点对话,我可以使用 HttpWebRequest.GetResponse() 与远程 Kerberos Sharepoint 框对话;

但我无法让它与带有 CientContext 的 Kerberos Sharepoint 框对话。任何额外的指针将不胜感激。

string siteURL = "http://my.remote.sharepoint";             
ClientContext ctx = new ClientContext(siteURL);           
CredentialCache cc = new CredentialCache();           
cc.Add(new Uri(siteURL), "Kerberos", CredentialCache.DefaultNetworkCredentials);            
ctx.AuthenticationMode = ClientAuthenticationMode.Default;         
ctx.Credentials =cc;

/////////////////////////////////////////////////////////////////////////////////
// This code confirms that I can access "my.remote.sharepoint" with KRB
//       HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(siteURL);
//       myHttpWebRequest.Credentials = cc;
//       myHttpWebRequest.UseDefaultCredentials = true;              
//       HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
/////////////////////////////////////////////////////////////////////////////////
Web remoteWeb = ctx.Web;
ctx.Load(remoteWeb);
ctx.ExecuteQuery();

//401 unauthorised returned from here

Wireshark 建议它返回最初的 401 然后放弃!任何想法

【问题讨论】:

    标签: sharepoint kerberos


    【解决方案1】:

    请检查是否为该主机注册了 SPN 并且是否存在反向 DNS 条目。

    【讨论】:

      猜你喜欢
      • 2012-05-17
      • 2011-01-15
      • 2011-06-19
      • 1970-01-01
      • 1970-01-01
      • 2016-04-15
      • 2017-02-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多