小编use*_*938的帖子

HTTP请求未经授权使用客户端身份验证方案"Negotiate"

1)在机器A上 - 我在MachineA上创建了一个WCF服务并将其托管在IIS 5.1上.在此URL下运行http://mydomain/SetupPOCService/Service1.svc

2)在机器B上 - 我创建了一个Asp.net Web Applciation.在这个应用程序中,我尝试使用以前创建的WCF服务,该服务现在托管在另一个m/c即MachineA上.当我从Visual Studio环境运行此Web应用程序时,它访问MachineA的WCF服务并获取数据.

---好到这里---

3)在机器B上 - 现在我在IIS5.1中托管了我的Web应用程序这个Web应用程序在这里工作正常,但无法访问MachineA的WCF服务并发出此类错误.

远程服务器返回错误:(401)未经授权.

StackTrace [MessageSecurityException:HTTP请求未经授权,客户端身份验证方案为"Negotiate".从服务器收到的身份验证标头是"Negotiate,NTLM".]

我尝试了很多东西,但它有助于提升.请提供您的意见......

下面是客户端的Web.Config

 <security mode="TransportCredentialOnly">
  <transport clientCredentialType="Windows" proxyCredentialType="None"
   realm="" />
  <message clientCredentialType="UserName" algorithmSuite="Default" />
 </security>
Run Code Online (Sandbox Code Playgroud)

下面是Web.Config for Server

<behaviors>
  <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
 </behavior>
Run Code Online (Sandbox Code Playgroud)

authentication wcf windows-authentication

10
推荐指数
1
解决办法
3万
查看次数