2009-09-11 39 views
0

每当我尝试使用通过WCF我的web服务,我收到此错误:另 - HTTP请求是未经授权的错误

The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLMnProviders'. 

我知道我正确的有Kerberos设置此环境(它调用的SharePoint 3.0服务我用于其他应用程序)。集成的Windows安全性一直很好,但这是我第一次尝试通过WCF使用它。

我已经多次通过这个site以确保我有正确的标题。上述错误是否因为期待“协商”而失败,但它正在接收“Negotiate,NTLMnProviders”?我知道我可以通过该网站更改我的标题,但它始终具有Kerberos标题的“Negotiate,NTLMnProviders”。任何人有任何想法?

+0

告诉我们您服务和客户端配置!你使用什么绑定?什么安全设置?没有相关信息,我们不能回答这样的问题....... – 2009-09-13 06:56:16

回答

0

不是一个真正的答案,但这里有一些更多的细节......

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="ListsSoap"> 
      <security mode="TransportCredentialOnly"> 
      <transport clientCredentialType="Windows" proxyCredentialType="Windows"/> 
      </security>   
     </binding> 
     <binding name="SiteDataSoap"> 
      <security mode="TransportCredentialOnly"> 
      <transport clientCredentialType="Windows" proxyCredentialType="Windows"/> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://something.com/_vti_bin/lists.asmx" 
      binding="basicHttpBinding" bindingConfiguration="ListsSoap" 
      contract="WSS_Server.ListsSoap" name="ListsSoap"> 
     <identity> 
      <dns value="localhost" /> 
     </identity> 
     </endpoint> 
     <endpoint address="http://something.com/_vti_bin/SiteData.asmx" 
      binding="basicHttpBinding" bindingConfiguration="SiteDataSoap" 
      contract="WSS_Server_SiteData.SiteDataSoap" name="SiteDataSoap"> 
     <identity> 
      <dns value="localhost" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

然后我实例化我的代理,并在代码中调用此...

proxy.ClientCredentials.Windows.AllowedImpersonationLevel = 
       System.Security.Principal.TokenImpersonationLevel.Impersonation; 

proxy.ClientCredentials.Windows.AllowNtlm = false; 

// Web service call 
proxy.GetWeb(...); 
相关问题